diff --git a/example/docs/zh-CN/components/slider.md b/example/docs/zh-CN/components/slider.md index ca5d1a02..e032027b 100644 --- a/example/docs/zh-CN/components/slider.md +++ b/example/docs/zh-CN/components/slider.md @@ -13,7 +13,7 @@ ::: demo 使用 `lay-slider` 标签, 创建滑块 @@ -63,7 +63,7 @@ export default { ::: demo + + diff --git a/src/component/slider/StandardRange.vue b/src/component/slider/StandardRange.vue new file mode 100644 index 00000000..c3b172b9 --- /dev/null +++ b/src/component/slider/StandardRange.vue @@ -0,0 +1,155 @@ + + + diff --git a/src/component/slider/Vertical.vue b/src/component/slider/Vertical.vue new file mode 100644 index 00000000..ab279e4a --- /dev/null +++ b/src/component/slider/Vertical.vue @@ -0,0 +1,112 @@ + + + diff --git a/src/component/slider/VerticalRange.vue b/src/component/slider/VerticalRange.vue new file mode 100644 index 00000000..a1449b53 --- /dev/null +++ b/src/component/slider/VerticalRange.vue @@ -0,0 +1,159 @@ + + + diff --git a/src/component/slider/index.less b/src/component/slider/index.less index 2d7410e5..ffec40c4 100644 --- a/src/component/slider/index.less +++ b/src/component/slider/index.less @@ -47,6 +47,14 @@ .layui-slider-disabled { cursor: not-allowed !important; } +.layui-slider-disabled .disable-line { + background-color: #c2c2c2 !important; +} + +.layui-slider-disabled .disable-btn { + border: 2px solid #333333; +} + .layui-slider-disabled-rate { background-color: @global-primary-color !important; } diff --git a/src/component/slider/index.vue b/src/component/slider/index.vue index 10177db3..4cd41a42 100644 --- a/src/component/slider/index.vue +++ b/src/component/slider/index.vue @@ -1,5 +1,94 @@ + + - - diff --git a/src/component/slider/utils/index.ts b/src/component/slider/utils/index.ts new file mode 100644 index 00000000..c639a3f0 --- /dev/null +++ b/src/component/slider/utils/index.ts @@ -0,0 +1,25 @@ +export function sleep(wait: number) { + return new Promise((resolve) => { + setTimeout(() => { + resolve(1); + }, wait); + }); +} + +export function throttle(func: Function) { + let timer: any = null; + return function (args: any) { + if (!timer) { + timer = setTimeout(() => { + timer = null; + func(args); + }, 20); + } + }; +} + +export function handle_select(e: Event): void { + e.preventDefault(); +} + +