The weex builtin component switch is used to create and manage an IOS styled On/Off buttons, for example, the Airplane mode button in the Settings app is a switch button.
There are no child components for the switch component.
- checked <boolean> true|false, default value is false, indicating whether the button is on or not.
- disabled <boolean> true|false, default value is false, indicating whether the button is enable or not.
Notes: There are several style properties that you mustn’t use on this component. And here are all the invalid properties:
- margin and margin-xxs
- padding and padding-xxs
- border and border-xxs
Notes: If the container of
<switch> is not set to
align-items:flex-start, the switch in android will be stretched.
common styles: check out common styles for components
- onappear / ondisappear event. check out common events
- onclick: check out common events
- onchange: check out common events
- value: the value of the component who dispatched this event, which is the boolean value true or false.
- timestamp: the time stamp of the event.