feat: add Checkbox and Radio field families
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import {
|
||||
Checkbox,
|
||||
CheckboxContent,
|
||||
CheckboxControl,
|
||||
CheckboxIndicator,
|
||||
Description,
|
||||
} from "@heroui-vue/components";
|
||||
const isIndeterminate = ref(true),
|
||||
isSelected = ref(false);
|
||||
function update(value: boolean) {
|
||||
isSelected.value = value;
|
||||
isIndeterminate.value = false;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<Checkbox
|
||||
id="select-all"
|
||||
:is-indeterminate="isIndeterminate"
|
||||
:checked="isSelected"
|
||||
@update:checked="update"
|
||||
>
|
||||
<CheckboxContent>
|
||||
<CheckboxControl><CheckboxIndicator /></CheckboxControl>
|
||||
全选
|
||||
</CheckboxContent>
|
||||
<Description>展示部分选中状态(短横线图标)</Description>
|
||||
</Checkbox>
|
||||
</template>
|
||||
Reference in New Issue
Block a user