Skip to content

开关

示例

🌙
🌞
no
yes
2
1
🌙
🌞

代码

html
<template>
  <m9-switch size="large">
    <template #checkVnode>🌞</template>
    <template #uncheckVnode>🌙</template>
  </m9-switch>
  <m9-switch size="medium"></m9-switch>
  <m9-switch size="small">
    <template #checkVnode>1</template>
    <template #uncheckVnode>2</template>
  </m9-switch>
  <m9-switch disabled>
    <template #checkVnode>🌞</template>
    <template #uncheckVnode>🌙</template>
  </m9-switch>
</template>

API

属性说明类型默认值
size设置开关大小small/medium/largemedium
checkVNode开启状态的虚拟节点string
uncheckVNode关闭状态的虚拟节点string

事件

事件名称说明参数
change切换开关事件(value: boolean) => void

K1舞动未来 - 技术引领潮流