开关 Switch
自研开关,支持开关文字提示。
Props
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
modelValue | boolean | string | number | false | 绑定值(v-model) |
activeText | string | '' | 开启时文字 |
inactiveText | string | '' | 关闭时文字 |
disabled | boolean | false | 是否禁用 |
事件
| 事件 | 参数 | 说明 |
|---|---|---|
update:modelValue | boolean | 切换时触发 |
示例
vue
<template>
<Switch v-model="enabled" active-text="开" inactive-text="关" />
</template>