スイッチを表示するコンポーネントです。
A switch is an UI element that can be used to toggle between two states.
The state of a switch in Onsen UI can be changed both by dragging the knob and by tapping on the switch.
To make the switch enabled by default you can use :modelProp="true", or v-model for two-way data binding.
To disable the switch the disabled prop is used.
| 名前 | 型 / デフォルト値 | 概要 |
|---|---|---|
| disabled | Boolean | スイッチを無効の状態にする場合に指定します。 Optional. |
| inputId | String |
Specify the id attribute of the inner <input> element. This is useful when using <label for="..."> elements.
(翻訳中)
Optional.
|
| modelEvent | Boolean | The native event which should trigger the update:modelValue event. (翻訳中) Optional. |
| modelValue | Boolean | Whether the switch is checked or not. (翻訳中) Optional. |
| modifier | String | スイッチの表現を指定します。 Optional. |
| Name | 概要 |
|---|---|
| material | Material Design switch (翻訳中) |
| 名前 | 概要 |
|---|---|
| change | ON/OFFが変わった時に発火します。 |
| update:modelValue | Fired right after the event set in the modelEvent prop. (翻訳中) |
ON/OFFが変わった時に発火します。
| 名前 | 型 | 概要 |
|---|---|---|
| event | Object | イベントオブジェクト。 |
| event.switch | Object | イベントが発火したSwitchオブジェクトを返します。 |
| event.value | Boolean | 現在の値を返します。 |
| event.isInteractive | Boolean | タップやクリックなどのユーザの操作によって変わった場合にはtrueを返します。 |
Fired right after the event set in the modelEvent prop. (翻訳中)
| 名前 | 型 | 概要 |
|---|
Onsen UIに関する質問は、Stack Overflowにてonsen-uiタグを付与してください。Onsen UIチームはあなたの問題解決をお手伝いします。
バグ報告や機能要望については、GitHub Issuesに記載をお願いいたします。
あわせて、下記の情報も参考にしてください。