Skip to content

Switch 开关 ​

用于在两个互斥状态之间快速切换。

基础用法 ​

Switch API ​

Attributes ​

属性说明类型默认值
modelValue当前值boolean / string / numberfalse
activeValue开启时写入的值boolean / string / numbertrue
inactiveValue关闭时写入的值boolean / string / numberfalse
activeText开启时显示的文字string''
inactiveText关闭时显示的文字string''
size控件尺寸stringdefault
disabled是否禁用booleanfalse
loading是否处于切换中booleanfalse

Events ​

事件名说明参数
update:modelValue切换后更新绑定值(value)
change切换完成后触发(value)

Slots ​

插槽名说明
default自定义状态文字;存在时优先于 activeText / inactiveText

Aurora Plus · Vue 3 Component Library