31 lines
715 B
Vue
31 lines
715 B
Vue
<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>
|