Skip to content

基本使用

关闭了
vue

<template>
  <zeroSwitch active-text="打开了" :in-active-value="0" :active-value="50" in-active-text="关闭了"
              v-model="value"></zeroSwitch>
</template>
<script setup>
  import {ref} from 'vue';
  const value = ref(0);
</script>

属性

属性名说明可选值默认值类型
v-model / modelValue双向绑定的值-trueString/Number/Boolean
disabled是否禁用true/falsefalseBoolean
activeValue打开的值-trueString
inActiveValue关闭的值-falseString
activeText打开的文本-String
inActiveText关闭的文本-String
activeColor打开的颜色-#8cc5ffString
inActiveColor关闭的颜色-#dcdfe6String