Skip to content

Switch 开关

基础用法

最普通的开关

loading

开关颜色

使用 activeColor 为开关打开时设置颜色, inactiveColor 为开关关闭时设置颜色

loading

禁用效果

使用 disabled 属性为开关设置禁用

loading

文字

使用 activeText 设置打开时显示的文字, inactiveText 设置关闭时显示的文字

loading

Switch API

Switch Attributes

属性名说明类型默认值
modelValue | v-model绑定的值(必需)boolean
disabled禁用booleanfalse
activeColor打开时颜色string#bebe
inactiveColor关闭时颜色string#C0CCDA
activeText打开时显示的文字string''
inactoveText关闭时显示的文字string''