未验证 提交 97212e91 编写于 作者: K king_he 提交者: Gitee

update en/application-dev/reference/arkui-ts/ts-basic-components-toggle.md.

Signed-off-by: Nking_he <6384784@qq.com>
上级 6a7d3d8c
# Toggle # Toggle
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**<br>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
...@@ -23,7 +23,7 @@ Toggle(options: { type: ToggleType, isOn?: boolean }) ...@@ -23,7 +23,7 @@ Toggle(options: { type: ToggleType, isOn?: boolean })
| Name | Type | Mandatory | Default Value | Description | | Name | Type | Mandatory | Default Value | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| type | ToggleType | Yes | - | Type of the toggle. | | type | ToggleType | Yes | - | Type of the toggle. |
| isOn | boolean | No | false | Initial state of the toggle.<br/>> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>> If **isOn** is not set during component creation, the selected state can be retained during component reuse. If **isOn** is set, the selected state needs to be retained during component reuse after the selected state is recorded using an event method. | | isOn | boolean | No | false | Initial state of the toggle.<br/>> **NOTE**<br/>> If **isOn** is not set during component creation, the selected state can be retained during component reuse. If **isOn** is set, the selected state needs to be retained during component reuse after the selected state is recorded using an event method. |
- ToggleType enums - ToggleType enums
...@@ -36,15 +36,15 @@ Toggle(options: { type: ToggleType, isOn?: boolean }) ...@@ -36,15 +36,15 @@ Toggle(options: { type: ToggleType, isOn?: boolean })
## Attributes ## Attributes
| Name | Type | Default Value | Description | | Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| selectedColor | Color | - | Background color of the toggle when it is enabled. | | selectedColor | Color | - | Background color of the toggle when it is enabled. |
| switchPointColor | Color | - | Color of the circular slider of the **Switch** type.<br/>> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>> This attribute is valid only when type is set to **ToggleType.Switch**. | | switchPointColor | Color | - | Color of the circular slider of the **Switch** type.<br/>> **NOTE**<br/>> This attribute is valid only when type is set to **ToggleType.Switch**. |
## Events ## Events
| Name | Description | | Name | Description |
| -------- | -------- | | -------- | -------- |
| onChange(callback: (isOn: boolean) =&gt; void) | Triggered when the switch status changes. | | onChange(callback: (isOn: boolean) =&gt; void) | Triggered when the switch status changes. |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册