Ver Fonte

完善部分文档与组件内的类型

dufu1991 há 10 meses atrás
pai
commit
00b9178f24

+ 1 - 1
docs/mds/components/actionSheet/api.md

@@ -5,7 +5,7 @@
 | visible        | `boolean`                                                   | `false`                           | N    | 是否显示。                          |
 | title          | `string`                                                    | `''`                              | N    | 标题。                              |
 | titleAlign     | `'left'\|'center'\|'right'`                                 | `'center'`                        | N    | 标题对齐方式。                      |
-| actions        | `Action[]`                                                  | `[]`                              | N    | 菜单选项,Action Props 组成的数组。 |
+| actions        | `Action[]`                                                  | `[]`                              | Y    | 菜单选项,Action Props 组成的数组。 |
 | popup          | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}`                              | N    | 弹出层参数。                        |
 | showCancel     | `boolean`                                                   | `false`                           | N    | 是否显示取消选项。                  |
 | cancelText     | `string`                                                    | 当前语言的 actionSheet.cancelText | N    | 取消选项文本。                      |

+ 1 - 1
docs/mds/components/actionSheet/api_en.md

@@ -5,7 +5,7 @@
 | visible        | `boolean`                                                   | `false`                                 | N        | Whether to show the action sheet.            |
 | title          | `string`                                                    | `''`                                    | N        | Title text.                                  |
 | titleAlign     | `'left'\|'center'\|'right'`                                 | `'center'`                              | N        | Title alignment.                             |
-| actions        | `Action[]`                                                  | `[]`                                    | N        | Menu options array composed of Action Props. |
+| actions        | `Action[]`                                                  | `[]`                                    | Y        | Menu options array composed of Action Props. |
 | popup          | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}`                                    | N        | Popup layer parameters.                      |
 | showCancel     | `boolean`                                                   | `false`                                 | N        | Whether to show cancel button.               |
 | cancelText     | `string`                                                    | Current language actionSheet.cancelText | N        | Cancel button text.                          |

+ 1 - 1
docs/mds/components/numKeyboard/api.md

@@ -25,6 +25,6 @@
 
 | 名称    | 类型                       | 参数                     | 描述                   |
 | ------- | -------------------------- | ------------------------ | ---------------------- |
-| onclick | `(key: string) => void`    | key - 本次点击的键盘 key | 每次点击任意按键触发。 |
+| onclick | `(key: '0'\|'1'\|'2'\|'3'\|'4'\|'5'\|'6'\|'7'\|'8'\|'9'\|'.'\|'delete'\|'close'\|'done') => void`    | key - 本次点击的键盘 key | 每次点击任意按键触发。 |
 | onopen  | `(height: number) => void` | height - 键盘高度        | 键盘打开时触发。       |
 | onclose | `() => void`               | -                        | 键盘关闭时触发。       |

+ 1 - 1
docs/mds/components/numKeyboard/api_en.md

@@ -25,6 +25,6 @@
 
 | Name    | Type                       | Parameters                 | Description                        |
 | ------- | -------------------------- | -------------------------- | ---------------------------------- |
-| onclick | `(key: string) => void`    | key - Clicked keyboard key | Triggered when any key is clicked. |
+| onclick | `(key: '0'\|'1'\|'2'\|'3'\|'4'\|'5'\|'6'\|'7'\|'8'\|'9'\|'.'\|'delete'\|'close'\|'done') => void`    | key - Clicked keyboard key | Triggered when any key is clicked. |
 | onopen  | `(height: number) => void` | height - Keyboard height   | Triggered when keyboard opens.     |
 | onclose | `() => void`               | -                          | Triggered when keyboard closes.    |

+ 1 - 1
packages/stdf/src/lib/components/numKeyboard/NumKeyboard.svelte

@@ -124,7 +124,7 @@
 		}
 		// 派发事件,传递出两个参数,输入的数字字符串和本次点击的类型
 		// Dispatch events, pass out two parameters, the input number string and the type of this click
-		onclick?.(key);
+		onclick?.(key as '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '.' | 'delete' | 'close' | 'done');
 	};
 
 	// 激活与关闭键盘事件

+ 1 - 1
packages/stdf/src/lib/components/switch/Switch.svelte

@@ -3,7 +3,7 @@
 	import type { SwitchProps } from '../../types/index.js';
 
 	let {
-		active = false,
+		active = $bindable(false),
 		radius = 'middle',
 		inside = null,
 		injClass = '',

+ 4 - 4
packages/stdf/src/routes/picker/en_US/+page.svelte

@@ -127,8 +127,8 @@
 	<div class="px-4">
 		{#if allItems.length}
 			Currently selected:
-			{#each allItems as item}
-				<span class="mr-2 text-primary dark:text-dark">{item.label}</span>
+			{#each allItems as item, index (index)}
+				<span class="text-primary dark:text-dark mr-2">{item.label}</span>
 			{/each}
 		{:else}
 			<div>Please select data</div>
@@ -137,8 +137,8 @@
 	<div class="px-4">
 		{#if allIndexs.length}
 			Currently selected value is located at the index of each column:
-			{#each allIndexs as index}
-				<span class="mr-2 text-primary dark:text-dark">{index}</span>
+			{#each allIndexs as index, i (i)}
+				<span class="text-primary dark:text-dark mr-2">{index}</span>
 			{/each}
 		{:else}
 			<div>Please select data</div>

+ 4 - 4
packages/stdf/src/routes/picker/zh_CN/+page.svelte

@@ -123,8 +123,8 @@
 	<div class="px-4">
 		{#if allItems.length}
 			当前选定了:
-			{#each allItems as item}
-				<span class="mr-2 text-primary dark:text-dark">{item.label}</span>
+			{#each allItems as item, index (index)}
+				<span class=" text-primary dark:text-dark mr-2">{item.label}</span>
 			{/each}
 		{:else}
 			<div>请选定数据</div>
@@ -133,8 +133,8 @@
 	<div class="px-4">
 		{#if allIndexs.length}
 			当前选定值位于所在列的索引值分别为:
-			{#each allIndexs as index}
-				<span class="mr-2 text-primary dark:text-dark">{index}</span>
+			{#each allIndexs as index, i (i)}
+				<span class="text-primary dark:text-dark mr-2">{index}</span>
 			{/each}
 		{:else}
 			<div>请选定数据</div>