mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
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:
parent
e69928e917
commit
18c1c77030
@ -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
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user