docs(components): [switch] add version tag & fix typo (#13771)

* docs(components): [switch] add version tag & fix typo

* chore: add tag
This commit is contained in:
btea 2023-07-31 18:21:42 +08:00 committed by GitHub
parent e69928e917
commit 18c1c77030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 27 deletions

View File

@ -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<boolean>` | — |
| 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<boolean>` | — |
| id | id for input | ^[string] | — |
| tabindex | tabindex for input | ^[string] / ^[number] | — |
### Events

View File

@ -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,