Switch

Switch is used to toggle a single setting on or off, typically used to represent two opposite states, such as on/off.

Switch

Switch is used to toggle a single setting on or off, typically used to represent two opposite states, such as on/off.

themeDocs.examples

Basic Usage

Basic usage of the switch, for toggling boolean values. By default, clicking toggles the switch state.

300px

Disabled State

Disabled switches cannot be clicked and are typically used to indicate that a feature is unavailable or you don't have permission to operate it.

300px

themeDocs.api

themeDocs.props

PropertyBasic component module for translation keys shared across all component documentation pagesTypeDefault
modelValue开关的值,使用v-model双向绑定Booleanfalse
disabled是否禁用开关Booleanfalse
label开关的无障碍标签,用于屏幕阅读器String'Switch'

themeDocs.events

EventBasic component module for translation keys shared across all component documentation pagesParameters
update:modelValue开关状态改变时触发,返回新值
No parameters
change开关状态改变时触发,返回新值
No parameters
Design Empowers, Innovation Unlimited