From af0349a46be76dcb60dc12fd555c0ea2da189e09 Mon Sep 17 00:00:00 2001 From: zhongyuan Date: Thu, 3 Nov 2022 16:48:03 +0800 Subject: [PATCH] docs(slider): update docs and demo (#458) * fix(slider): update docs and demo * docs(slider): update docs and demo * fix(slider): update snap --- .../__test__/__snapshots__/demo.test.jsx.snap | 547 +++++++----------- src/slider/__test__/demo.test.jsx | 4 + src/slider/demos/base.vue | 5 +- src/slider/demos/disable.vue | 33 +- src/slider/demos/mark.vue | 8 +- src/slider/demos/mobile.vue | 16 +- src/slider/demos/title.vue | 18 + src/slider/demos/unZero.vue | 3 + src/slider/demos/value.vue | 2 +- 9 files changed, 257 insertions(+), 379 deletions(-) create mode 100644 src/slider/demos/title.vue create mode 100644 src/slider/demos/unZero.vue diff --git a/src/slider/__test__/__snapshots__/demo.test.jsx.snap b/src/slider/__test__/__snapshots__/demo.test.jsx.snap index 8af47150b..77599182f 100644 --- a/src/slider/__test__/__snapshots__/demo.test.jsx.snap +++ b/src/slider/__test__/__snapshots__/demo.test.jsx.snap @@ -15,13 +15,13 @@ exports[`Slider > Slider baseVue demo works fine 1`] = `
@@ -39,200 +39,38 @@ exports[`Slider > Slider baseVue demo works fine 1`] = ` exports[`Slider > Slider disableVue demo works fine 1`] = `
- +
+
- -
- -
- -
- - -
- - -
- - -
-
-
- 60 -
- -
-
-
+ class="t-slider__bar" + /> +
- -
- -
- -
- - -
- - -
- - -
-
-
- 30 -
- -
-
-
+ class="t-slider__track" + style="width: 0%;" + /> + +
- -
- -
- -
- - -
- - -
- -
- 小 -
-
- 中 -
-
- 大 -
- -
-
- - -
-
-
+ class="t-slider__handle" + style="left: 0%;" + /> + +
- -
- -
- -
- - -
-
- - -
- - -
-
- - + +
- + +
`; @@ -306,7 +144,7 @@ exports[`Slider > Slider mobileVue demo works fine 1`] = ` class="summary" data-v-98828574="" > - 滑动滑块来选择一个数值,在具体场景中也可以增加来刻度和展示数值来方便用户使用 + 用于选择横轴上的数值、区间、档位

Slider mobileVue demo works fine 1`] = `
@@ -395,13 +233,13 @@ exports[`Slider > Slider mobileVue demo works fine 1`] = `
@@ -415,7 +253,7 @@ exports[`Slider > Slider mobileVue demo works fine 1`] = `
- 60 + 50
@@ -469,11 +307,7 @@ exports[`Slider > Slider mobileVue demo works fine 1`] = `
-
- 30 -
+
@@ -634,160 +468,127 @@ exports[`Slider > Slider mobileVue demo works fine 1`] = ` class="slider-demo" data-v-98828574="" > -
+
- +
- -
- -
- - -
- - -
- - -
-
+ class="t-slider__bar" + /> +
- 60 -
- -
-
-
-
- + class="t-slider__track" + style="width: 0%;" + /> + +
+ + +
- -
- -
- -
- -
- - -
-
-
- 30
-
+ +
+
+ +
+
+

+ 03 规格 +

+

+ 无标题滑动选择器 +

+ +
+
- +
+ +
+ + +
+ + +
- -
- -
- -
- -
- -
- 小 -
-
- 中 -
-
- 大 -
- -
- -
+ +
+
+ +
+
+ +

+ 有标题滑动选择器 +

+ +
+ + 选择器标题 +
Slider mobileVue demo works fine 1`] = `
-
@@ -825,7 +622,6 @@ exports[`Slider > Slider mobileVue demo works fine 1`] = `
-
@@ -881,6 +677,89 @@ exports[`Slider > Slider rangeVue demo works fine 1`] = `
`; +exports[`Slider > Slider titleVue demo works fine 1`] = ` +
+ + 选择器标题 + +
+ +
+ +
+ +
+ + +
+ + +
+ + +
+
+ + +
+
+`; + +exports[`Slider > Slider unZeroVue demo works fine 1`] = ` +
+ +
+ +
+ +
+ + +
+ + +
+ + +
+
+ + +
+`; + exports[`Slider > Slider valueVue demo works fine 1`] = `
Slider valueVue demo works fine 1`] = `
@@ -916,7 +795,7 @@ exports[`Slider > Slider valueVue demo works fine 1`] = `
- 60 + 50
diff --git a/src/slider/__test__/demo.test.jsx b/src/slider/__test__/demo.test.jsx index dc354a258..59bb1a104 100644 --- a/src/slider/__test__/demo.test.jsx +++ b/src/slider/__test__/demo.test.jsx @@ -8,6 +8,8 @@ import disableVue from '@/slider/demos/disable.vue'; import markVue from '@/slider/demos/mark.vue'; import mobileVue from '@/slider/demos/mobile.vue'; import rangeVue from '@/slider/demos/range.vue'; +import titleVue from '@/slider/demos/title.vue'; +import unZeroVue from '@/slider/demos/unZero.vue'; import valueVue from '@/slider/demos/value.vue'; const mapper = { @@ -16,6 +18,8 @@ const mapper = { markVue, mobileVue, rangeVue, + titleVue, + unZeroVue, valueVue, }; diff --git a/src/slider/demos/base.vue b/src/slider/demos/base.vue index aa14586e7..f3ae96178 100644 --- a/src/slider/demos/base.vue +++ b/src/slider/demos/base.vue @@ -1,12 +1,11 @@ - - diff --git a/src/slider/demos/mark.vue b/src/slider/demos/mark.vue index 04471ed05..01c3c53b9 100644 --- a/src/slider/demos/mark.vue +++ b/src/slider/demos/mark.vue @@ -1,5 +1,5 @@ diff --git a/src/slider/demos/mobile.vue b/src/slider/demos/mobile.vue index 2446a3594..7a5c2d1a0 100644 --- a/src/slider/demos/mobile.vue +++ b/src/slider/demos/mobile.vue @@ -1,7 +1,7 @@ @@ -41,6 +51,8 @@ import MarkDemo from './mark.vue'; import ValueDemo from './value.vue'; import RangeDemo from './range.vue'; import DisableDemo from './disable.vue'; +import UnZeroDemo from './unZero.vue'; +import TitleDemo from './title.vue'; diff --git a/src/slider/demos/unZero.vue b/src/slider/demos/unZero.vue new file mode 100644 index 000000000..a6c8b4db0 --- /dev/null +++ b/src/slider/demos/unZero.vue @@ -0,0 +1,3 @@ + diff --git a/src/slider/demos/value.vue b/src/slider/demos/value.vue index e6ac6488a..13caa0233 100644 --- a/src/slider/demos/value.vue +++ b/src/slider/demos/value.vue @@ -5,5 +5,5 @@