feat: add Checkbox and Radio field families

This commit is contained in:
maoyingjie
2026-10-22 09:15:27 +08:00
parent a4fb3c550a
commit bcadbeaf8c
75 changed files with 5293 additions and 22 deletions
@@ -0,0 +1,49 @@
<script setup lang="ts">
import {
CheckboxGroup,
CheckboxContent,
CheckboxControl,
CheckboxIndicator,
Checkbox,
Label,
} from "@heroui-vue/components";
import { ref } from "vue";
const selected = ref(["coding", "design"]);
</script>
<template>
<CheckboxGroup
class="min-w-[320px]"
name="skills"
:model-value="selected"
@update:model-value="selected = $event"
>
<Label>你的技能</Label>
<Checkbox value="coding">
<CheckboxContent>
<CheckboxControl>
<CheckboxIndicator />
</CheckboxControl>
编程
</CheckboxContent>
</Checkbox>
<Checkbox value="design">
<CheckboxContent>
<CheckboxControl>
<CheckboxIndicator />
</CheckboxControl>
设计
</CheckboxContent>
</Checkbox>
<Checkbox value="writing">
<CheckboxContent>
<CheckboxControl>
<CheckboxIndicator />
</CheckboxControl>
写作
</CheckboxContent>
</Checkbox>
<Label class="my-4 text-sm text-muted">
已选:{{ selected.join(", ") || "无" }}
</Label>
</CheckboxGroup>
</template>