feat: add Checkbox and Radio field families
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user