Skip to content

Commit

Permalink
docs(components): [switch] add version tag & fix typo (#13771)
Browse files Browse the repository at this point in the history
* docs(components): [switch] add version tag & fix typo

* chore: add tag
  • Loading branch information
btea committed Jul 31, 2023
1 parent e69928e commit 18c1c77
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
50 changes: 25 additions & 25 deletions docs/en-US/component/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions packages/components/switch/src/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 18c1c77

Please sign in to comment.