Skip to content

Commit

Permalink
Slider: add tooltip-class (#9957)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leopoldthecoder authored and QingWei-Li committed Mar 1, 2018
1 parent 5f75ab8 commit 2ccb0ea
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/docs/en-US/slider.md
Expand Up @@ -241,7 +241,8 @@ Selecting a range of values is supported.
| vertical | vertical mode | boolean || false |
| height | Slider height, required in vertical mode | string |||
| label | label for screen reader | string |||
|debounce| debounce delay when typing, in milliseconds, works when `show-input` is true | number || 300 |
| debounce | debounce delay when typing, in milliseconds, works when `show-input` is true | number || 300 |
| tooltip-class | custom class name for the tooltip | string |||

## Events
| Event Name | Description | Parameters |
Expand Down
1 change: 1 addition & 0 deletions examples/docs/es/slider.md
Expand Up @@ -244,6 +244,7 @@ Se soporta la selección de un rango de valores.
| height | alto del Slider, requerido en modo vertical | string |||
| label | etiqueta para screen reader | string |||
| debounce | retardo al escribir, en milisegundos, funciona cuando`show-input` es true. | number || 300 |
| tooltip-class | custom class name for the tooltip | string |||

## Eventos
| Nombre | Descripción | Parametros |
Expand Down
1 change: 1 addition & 0 deletions examples/docs/zh-CN/slider.md
Expand Up @@ -239,6 +239,7 @@
| height | Slider 高度,竖向模式时必填 | string |||
| label | 屏幕阅读器标签 | string |||
| debounce | 输入时的去抖延迟,毫秒,仅在`show-input`等于true时有效 | number || 300 |
| tooltip-class | tooltip 的自定义类名 | string |||

### Events
| 事件名称 | 说明 | 回调参数 |
Expand Down
9 changes: 7 additions & 2 deletions packages/slider/src/button.vue
Expand Up @@ -15,7 +15,11 @@
@keydown.down.prevent="onLeftKeyDown"
@keydown.up.prevent="onRightKeyDown"
>
<el-tooltip placement="top" ref="tooltip" :disabled="!showTooltip">
<el-tooltip
placement="top"
ref="tooltip"
:popper-class="tooltipClass"
:disabled="!showTooltip">
<span slot="content">{{ formatValue }}</span>
<div class="el-slider__button" :class="{ 'hover': hovering, 'dragging': dragging }"></div>
</el-tooltip>
Expand All @@ -40,7 +44,8 @@
vertical: {
type: Boolean,
default: false
}
},
tooltipClass: String
},
data() {
Expand Down
5 changes: 4 additions & 1 deletion packages/slider/src/main.vue
Expand Up @@ -33,11 +33,13 @@
<slider-button
:vertical="vertical"
v-model="firstValue"
:tooltip-class="tooltipClass"
ref="button1">
</slider-button>
<slider-button
:vertical="vertical"
v-model="secondValue"
:tooltip-class="tooltipClass"
ref="button2"
v-if="range">
</slider-button>
Expand Down Expand Up @@ -122,7 +124,8 @@
},
label: {
type: String
}
},
tooltipClass: String
},
components: {
Expand Down
3 changes: 3 additions & 0 deletions types/slider.d.ts
Expand Up @@ -53,4 +53,7 @@ export declare class ElSlider extends ElementUIComponent {

/** Debounce delay when typing, in milliseconds, works when show-input is true */
debounce: number

/** Custom class name for the tooltip */
tooltipClass: string
}

0 comments on commit 2ccb0ea

Please sign in to comment.