Skip to content

vCheckboxGroup 复选框组

复选框组组件。

基础用法

vue
<script setup>
import { ref } from 'vue'
import { vCheckboxGroup } from '@twi1i9ht/visual-lib'

const checked = ref(['a'])
const options = [
  { label: '选项A', value: 'a' },
  { label: '选项B', value: 'b' },
  { label: '选项C', value: 'c' },
]
</script>

<template>
  <vCheckboxGroup v-model="checked" :options="options" />
</template>

Props

属性类型默认值说明
modelValueArray<string | number>[]绑定值
optionsArray<{ label: string, value: string | number, disabled?: boolean }>选项
disabledbooleanfalse全部禁用
minnumber最少选择数量
maxnumber最多选择数量
direction'horizontal' | 'vertical''horizontal'排列方向

Events

事件名参数说明
update:modelValuevalue[]值变化
changevalue[]选中值变化

Released under the MIT License.