Pārlūkot izejas kodu

[doc]更新Slider组件文档,修正showTip和radius属性的格式,确保一致性。同时在示例代码中随机选择showTip属性值。

dufu1991 1 gadu atpakaļ
vecāks
revīzija
6b37244e52

+ 2 - 2
docs/mds/components/slider/api.md

@@ -9,8 +9,8 @@
 | isRange    | `boolean`                   | `false`   | N    | 是否为区间选择。 |
 | startValue | `number`                    | `20`      | N    | 区间选择开始值。 |
 | endValue   | `number`                    | `60`      | N    | 区间选择结束值。 |
-| showTip    | `'always'\|'never'\|'touch` | `'touch'` | N    | 提示显示方式。   |
-| radius     | `'none'\|'sm'\|'xl'\|'full` | `'full'`  | N    | 圆角风格。       |
+| showTip    | `'always'\|'never'\|'touch'` | `'touch'` | N    | 提示显示方式。   |
+| radius     | `'none'\|'sm'\|'xl'\|'full'` | `'full'`  | N    | 圆角风格。       |
 | lineBlock  | `boolean`                   | `false`   | N    | 滑块是否为线框。 |
 | disabled   | `boolean`                   | `false`   | N    | 是否禁用。       |
 | readonly   | `boolean`                   | `false`   | N    | 是否只读。       |

+ 2 - 2
docs/mds/components/slider/api_en.md

@@ -9,8 +9,8 @@
 | isRange    | `boolean`                   | `false`   | N        | Whether it's a range selection.     |
 | startValue | `number`                    | `20`      | N        | Start value for range selection.    |
 | endValue   | `number`                    | `60`      | N        | End value for range selection.      |
-| showTip    | `'always'\|'never'\|'touch` | `'touch'` | N        | Tip display mode.                   |
-| radius     | `'none'\|'sm'\|'xl'\|'full` | `'full'`  | N        | Border radius style.                |
+| showTip    | `'always'\|'never'\|'touch'` | `'touch'` | N        | Tip display mode.                   |
+| radius     | `'none'\|'sm'\|'xl'\|'full'` | `'full'`  | N        | Border radius style.                |
 | lineBlock  | `boolean`                   | `false`   | N        | Whether the slider is a line block. |
 | disabled   | `boolean`                   | `false`   | N        | Whether it's disabled.              |
 | readonly   | `boolean`                   | `false`   | N        | Whether it's read-only.             |

+ 3 - 1
docs/site/src/routes/+page.svelte

@@ -120,6 +120,8 @@
 	// slider radius 随机 'none'|'full'|'sm'|'xl'
 	const sliderRadiusList = ['none', 'full', 'sm', 'xl'];
 	const sliderRadius = sliderRadiusList[Math.floor(Math.random() * sliderRadiusList.length)] as 'none' | 'full' | 'sm' | 'xl';
+	const sliderShowTipList = ['always', 'never', 'touch'];
+	const sliderShowTip = sliderShowTipList[Math.floor(Math.random() * sliderShowTipList.length)] as 'always' | 'never' | 'touch';
 	// 列举 20 个与评分相关的 emoji 表情
 	const emojiList1 = ['love', 'default'];
 	const emojiList2 = ['👍', '👋', '👏', '🌺', '🏆', '🎯', '💯', '🎳', '🎖️'];
@@ -642,7 +644,7 @@
 				<NoticeBar vertical {textList}></NoticeBar>
 			</div>
 			<div class="animate-elementUpDownMove1 absolute inset-1/2 w-64 -translate-y-20 translate-x-32">
-				<Slider value={sliderValue} showTip="always" radius={sliderRadius} />
+				<Slider value={sliderValue} showTip={sliderShowTip} radius={sliderRadius} />
 			</div>
 			<div class="animate-elementUpDownMove5 h-54 -translate-x-110 absolute inset-1/2 w-[390px] translate-y-16 overflow-hidden">
 				<Swiper {...swiperOption} />