diff --git a/package/component/src/component/switch/index.vue b/package/component/src/component/switch/index.vue index 6b970891..0070d5a7 100644 --- a/package/component/src/component/switch/index.vue +++ b/package/component/src/component/switch/index.vue @@ -19,12 +19,15 @@ export interface LaySwitchProps { onswitchValue?: string | number | boolean; unswitchValue?: string | number | boolean; size?: "lg" | "md" | "sm" | "xs"; + loadingIcon?: string; + loading?: boolean; } const props = withDefaults(defineProps(), { disabled: false, onswitchValue: true, unswitchValue: false, + loadingIcon: "layui-icon-loading-one", size: "md", }); @@ -75,8 +78,13 @@ const styles = computed(() => { {{ isActive == true ? onswitchText : unswitchText }}
- - + +
diff --git a/package/document-component/src/document/zh-CN/components/switch.md b/package/document-component/src/document/zh-CN/components/switch.md index 71b820bf..fc9eb088 100644 --- a/package/document-component/src/document/zh-CN/components/switch.md +++ b/package/document-component/src/document/zh-CN/components/switch.md @@ -149,10 +149,10 @@ export default { ::: title 自定义值 ::: -::: demo +::: demo 通过 onswitch-value 与 unswitch-value 属性, 设置不同状态的值。 + +::: + ::: title Switch 属性 ::: @@ -218,6 +247,8 @@ export default { | onswitch-value | 启用值 | `true` | | unswitch-value | 禁用值 | `false` | | size | 尺寸 | `lg` `md` `sm` `xs` | +| loading | 加载状态 | `true` `false` | +| loading-icon | 加载图标 | -- | :::