From 18c1c77030077dbdf59d57fe7ecce0652d8ee372 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Mon, 31 Jul 2023 18:21:42 +0800 Subject: [PATCH] docs(components): [switch] add version tag & fix typo (#13771) * docs(components): [switch] add version tag & fix typo * chore: add tag --- docs/en-US/component/switch.md | 50 ++++++++++++------------ packages/components/switch/src/switch.ts | 4 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/en-US/component/switch.md b/docs/en-US/component/switch.md index f1bb387e99..61606513ad 100644 --- a/docs/en-US/component/switch.md +++ b/docs/en-US/component/switch.md @@ -79,7 +79,7 @@ switch/prevent-switching ::: -## custom action icon +## custom action icon ^(2.3.9) :::demo You can add `active-action-icon` and `inactive-active-icon` attribute to show icons. @@ -91,30 +91,30 @@ switch/custom-action-icon ### Attributes -| Name | Description | Type | Default | -| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------- | -| model-value / v-model | binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type | ^[boolean] / ^[string] / ^[number] | false | -| disabled | whether Switch is disabled | ^[boolean] | false | -| loading | whether Switch is in loading state | ^[boolean] | false | -| size | size of Switch | ^[enum]`'' \| 'large' \| 'default' \| 'small'` | '' | -| width | width of Switch | ^[number] / ^[string] | '' | -| inline-prompt | whether icon or text is displayed inside dot, only the first character will be rendered for text | ^[boolean] | false | -| active-icon | component of the icon displayed when in `on` state, overrides `active-text` | ^[string] / ^[Component] | — | -| inactive-icon | component of the icon displayed when in `off` state, overrides `inactive-text` | ^[string] / ^[Component] | — | -| active-action-icon | component of the icon displayed in action when in `on` state | ^[string] / ^[Component] | — | -| inactive-action-icon | component of the icon displayed in action when in `off` state | ^[string] / ^[Component] | — | -| active-text | text displayed when in `on` state | ^[string] | '' | -| inactive-text | text displayed when in `off` state | ^[string] | '' | -| active-value | switch value when in `on` state | ^[boolean] / ^[string] / ^[number] | true | -| inactive-value | switch value when in `off` state | ^[boolean] / ^[string] / ^[number] | false | -| active-color ^(deprecated) | background color when in `on` state ( deprecated, use CSS var `--el-switch-on-color` instead ) | ^[string] | '' | -| inactive-color ^(deprecated) | background color when in `off` state ( deprecated, use CSS var `--el-switch-off-color` instead ) | ^[string] | '' | -| border-color ^(deprecated) | border color of the switch ( deprecated, use CSS var `--el-switch-border-color` instead ) | ^[string] | '' | -| name | input name of Switch | ^[string] | '' | -| validate-event | whether to trigger form validation | ^[boolean] | true | -| before-change | before-change hook before the switch state changes. If `false` is returned or a `Promise` is returned and then is rejected, will stop switching | ^[boolean] / ^[Function]`() => Promise` | — | -| id | id for input | ^[string] | — | -| tabindex | tabindex for input | ^[string] / ^[number] | — | +| Name | Description | Type | Default | +| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------- | +| model-value / v-model | binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type | ^[boolean] / ^[string] / ^[number] | false | +| disabled | whether Switch is disabled | ^[boolean] | false | +| loading | whether Switch is in loading state | ^[boolean] | false | +| size | size of Switch | ^[enum]`'' \| 'large' \| 'default' \| 'small'` | '' | +| width | width of Switch | ^[number] / ^[string] | '' | +| inline-prompt | whether icon or text is displayed inside dot, only the first character will be rendered for text | ^[boolean] | false | +| active-icon | component of the icon displayed when in `on` state, overrides `active-text` | ^[string] / ^[Component] | — | +| inactive-icon | component of the icon displayed when in `off` state, overrides `inactive-text` | ^[string] / ^[Component] | — | +| active-action-icon ^(2.3.9) | component of the icon displayed in action when in `on` state | ^[string] / ^[Component] | — | +| inactive-action-icon ^(2.3.9) | component of the icon displayed in action when in `off` state | ^[string] / ^[Component] | — | +| active-text | text displayed when in `on` state | ^[string] | '' | +| inactive-text | text displayed when in `off` state | ^[string] | '' | +| active-value | switch value when in `on` state | ^[boolean] / ^[string] / ^[number] | true | +| inactive-value | switch value when in `off` state | ^[boolean] / ^[string] / ^[number] | false | +| active-color ^(deprecated) | background color when in `on` state ( deprecated, use CSS var `--el-switch-on-color` instead ) | ^[string] | '' | +| inactive-color ^(deprecated) | background color when in `off` state ( deprecated, use CSS var `--el-switch-off-color` instead ) | ^[string] | '' | +| border-color ^(deprecated) | border color of the switch ( deprecated, use CSS var `--el-switch-border-color` instead ) | ^[string] | '' | +| name | input name of Switch | ^[string] | '' | +| validate-event | whether to trigger form validation | ^[boolean] | true | +| before-change | before-change hook before the switch state changes. If `false` is returned or a `Promise` is returned and then is rejected, will stop switching | ^[boolean] / ^[Function]`() => Promise` | — | +| id | id for input | ^[string] | — | +| tabindex | tabindex for input | ^[string] / ^[number] | — | ### Events diff --git a/packages/components/switch/src/switch.ts b/packages/components/switch/src/switch.ts index 854e19a680..4832f3ae86 100644 --- a/packages/components/switch/src/switch.ts +++ b/packages/components/switch/src/switch.ts @@ -60,13 +60,13 @@ export const switchProps = buildProps({ default: false, }, /** - * @description component of the icon displayed in action when in `on` state + * @description component of the icon displayed in action when in `off` state */ inactiveActionIcon: { type: iconPropType, }, /** - * @description component of the icon displayed in action when in `off` state + * @description component of the icon displayed in action when in `on` state */ activeActionIcon: { type: iconPropType,