Skip to content

开关 Switch ​

自研开关,支持开关文字提示。

Props

属性类型默认值说明
modelValueboolean | string | numberfalse绑定值(v-model)
activeTextstring''开启时文字
inactiveTextstring''关闭时文字
disabledbooleanfalse是否禁用

事件

事件参数说明
update:modelValueboolean切换时触发

示例

vue
<template>
  <Switch v-model="enabled" active-text="开" inactive-text="关" />
</template>

Released under the MIT License.