diff --git a/components/slider/demos/basic.md b/components/slider/demos/basic.md index bc3582ad7..ec0d64670 100644 --- a/components/slider/demos/basic.md +++ b/components/slider/demos/basic.md @@ -7,8 +7,7 @@ order: 0 值不让它超出该范围 ```vdt -import {Slider} from 'kpc'; -import {Button} from 'kpc'; +import {Slider, Button} from 'kpc';
diff --git a/components/slider/demos/disabled.md b/components/slider/demos/disabled.md index b96660e0a..013ddcfa0 100644 --- a/components/slider/demos/disabled.md +++ b/components/slider/demos/disabled.md @@ -10,6 +10,6 @@ import {Slider} from 'kpc';
- +
``` diff --git a/components/slider/demos/dynamicStep.md b/components/slider/demos/dynamicStep.md index e0fe31793..d65fef227 100644 --- a/components/slider/demos/dynamicStep.md +++ b/components/slider/demos/dynamicStep.md @@ -18,6 +18,6 @@ import {Slider} from 'kpc'; '500': 50 }} showTooltip - isShowStop + points /> ``` diff --git a/components/slider/demos/marks.md b/components/slider/demos/marks.md index 9d45dbc5f..314712942 100644 --- a/components/slider/demos/marks.md +++ b/components/slider/demos/marks.md @@ -13,12 +13,12 @@ import {Slider} from 'kpc';
diff --git a/components/slider/demos/points.md b/components/slider/demos/points.md index 71583d3af..5af428625 100644 --- a/components/slider/demos/points.md +++ b/components/slider/demos/points.md @@ -10,9 +10,9 @@ order: 4 import {Slider} from 'kpc';
- - - + +
diff --git a/components/slider/demos/range.md b/components/slider/demos/range.md index b856e4bbc..c44914c81 100644 --- a/components/slider/demos/range.md +++ b/components/slider/demos/range.md @@ -3,12 +3,12 @@ title: 范围选择 order: 3 --- -指定`isRange`使组件支持范围选择,此时`v-model`绑定的数据为数组,并且不会展示`input`输入框。 +指定`range`使组件支持范围选择,此时`v-model`绑定的数据为数组,并且不会展示`input`输入框。 ```vdt import {Slider} from 'kpc'; - console.log(v)}/> + console.log(v)}/> ``` ```ts diff --git a/components/slider/demos/step.md b/components/slider/demos/step.md index c2ebe41b4..c8b0a67e6 100644 --- a/components/slider/demos/step.md +++ b/components/slider/demos/step.md @@ -12,7 +12,7 @@ order: 1 import {Slider} from 'kpc';
- +
diff --git a/components/slider/demos/tooltip.md b/components/slider/demos/tooltip.md index 59f30fd53..448520872 100644 --- a/components/slider/demos/tooltip.md +++ b/components/slider/demos/tooltip.md @@ -3,7 +3,7 @@ title: 展示提示气泡 order: 6 --- -给组件添加`isShowTooltip`可以在滑块上展示气泡提示,默认展示当前值,我们也可以通过`tooltip`扩展点自定义展示内容; +给组件添加`showTooltip`可以在滑块上展示气泡提示,默认展示当前值,我们也可以通过`tooltip`扩展点自定义展示内容; 当添加`always`属性时,将一直展示提示气泡。通过`tooltipProps`可以设置`Tooltip`的所有属性 > `tooltip`扩展点和`Tooltip`组件的`content`扩展点行为一样,如果你传入空的内容,则不会展示气泡 @@ -12,12 +12,12 @@ order: 6 import {Slider} from 'kpc';
- - + + @@ -25,7 +25,7 @@ import {Slider} from 'kpc'; @@ -34,10 +34,10 @@ import {Slider} from 'kpc'; ```ts interface Props { - value1: number - values: [number, number] - value2: number - value3: number + value1?: number + values?: [number, number] + value2?: number + value3?: number } export default class extends Component { diff --git a/components/slider/index.md b/components/slider/index.md index ef7ae3ac5..905c9de6e 100644 --- a/components/slider/index.md +++ b/components/slider/index.md @@ -12,14 +12,15 @@ sidebar: doc | min | 最小值 | `Number` | 0 | | max | 最大值 | `Number` | 100 | | value | 当前值,可用`v-model`双向绑定 | `Number` | `Array` | `min` | +| range | 是否是范围选择 | `Boolean` | `false` | | unit | 单位,用于刻度展示 | `String` | `""` | -| isShowEnd | 是否展示最小值和最大值刻度 | `Boolean` | `true` | -| isShowInput | 是否展示输入框 | `Boolean` | `true` | +| showEnd | 是否展示最小值和最大值刻度 | `Boolean` | `true` | +| showInput | 是否展示输入框 | `Boolean` | `true` | | step | 步长,支持动态步长,详见示例 | `Number` | `Object` | `1` | | forceStep | 是否限制`value`除边界之外,满足`min + step * n`(`n`为整数) | `Boolean` | `true` | | points | 是否展示间隔点,或者指定哪些值展示间隔点 | `boolean` | `number[]` | `false` | | marks | 标注刻度 | `Object` | `undefined` | -| isShowTooltip | 是否展示提示气泡,默认不展示 | `Boolean` | `false` | +| showTooltip | 是否展示提示气泡,默认不展示 | `Boolean` | `false` | | always | 当展示气泡时,是否一直展示 | `Boolean` | `false` | | animate | 滑块的移动是否使用缓动动画 | `Boolean` | `true` | | tooltipProps | 设置`Tooltip`的所有属性 | `Object` | `undefined` | diff --git a/components/slider/index.ts b/components/slider/index.ts index 87292b371..430fede14 100644 --- a/components/slider/index.ts +++ b/components/slider/index.ts @@ -17,15 +17,15 @@ export interface SliderProps { max?: number min?: number value?: Value - isRange?: boolean + range?: boolean unit?: string - isShowEnd?: boolean - isShowInput?: boolean + showEnd?: boolean + showInput?: boolean step?: number | StepObject | StepFunction points?: number[] | boolean marks?: Marks disabled?: boolean - isShowTooltip?: boolean + showTooltip?: boolean always?: boolean animate?: boolean tooltipProps?: TooltipProps @@ -45,15 +45,15 @@ const typeDefs: Required> = { max: Number, min: Number, value: [Number, Array], - isRange: Boolean, + range: Boolean, unit: String, - isShowEnd: Boolean, - isShowInput: Boolean, + showEnd: Boolean, + showInput: Boolean, step: [Number, Object, Function], points: [Array, Boolean], marks: Object, disabled: Boolean, - isShowTooltip: Boolean, + showTooltip: Boolean, always: Boolean, animate: Boolean, tooltipProps: Object, @@ -67,8 +67,8 @@ const defaults = (): Partial => ({ min: 0, value: 0, unit: '', - isShowEnd: true, - isShowInput: true, + showEnd: true, + showInput: true, step: defaultStep, animate: true, forceStep: true, diff --git a/components/slider/index.vdt b/components/slider/index.vdt index 0fa1ca211..cfd89fe45 100644 --- a/components/slider/index.vdt +++ b/components/slider/index.vdt @@ -6,10 +6,10 @@ import {makeStyles} from './styles'; const { disabled, className, max, - min, unit, isShowInput, - isRange, step, value, - spinnerProps, isShowEnd, - isShowTooltip, animate, forceStep + min, unit, showInput, + range, step, value, + spinnerProps, showEnd, + showTooltip, animate, forceStep } = this.get(); const { onStart, trackRef, dragging, @@ -35,7 +35,7 @@ const createThumb = (thumbStyle, isFirst, ref, value, tooltipRef) => { return (
+