Checkbox (复选框)
布尔复选框(v-model),可带标签。
基础用法
Basic.vue
颜色
Colors.vue
尺寸
Sizes.vue
三态 / 不确定
Indeterminate.vue
单选外观
Single.vue
禁用
Disabled.vue
描述与错误
我们会在有新内容时通知你
必须同意条款才能继续
Description.vue
属性
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| className | string | "" | |
| color | KunUIColor | "default" | |
| description | string | "" | Helper text below the control (hidden when `error` is set). |
| disabled | boolean | false | |
| error | string | "" | Error message (red text below + danger box). Takes precedence over description. |
| id | string | — | |
| indeterminate | boolean | false | Tri-state "some but not all" (e.g. a select-all parent). Visual dash that overrides the check; the underlying input stays unchecked until toggled. |
| label | string | — | |
| modelValue | boolean | false | |
| name | string | — | |
| size | KunUISize | "md" | |
| type | "multiple" | "single" | "multiple" | |
| value | string | number | boolean | — |
事件
| 事件 | 回调参数 | 说明 |
|---|---|---|
| change | value: boolean | The new checked state, from a user toggle. |
| update:modelValue | value: boolean |
插槽
| 插槽 | 作用域 |
|---|---|
| #default | — |