Files
heroui-vue/apps/docs/demos/select-with-disabled-options.vue
T

55 lines
1.3 KiB
Vue

<script setup lang="ts">
import {
Select,
SelectTrigger,
SelectValue,
SelectIndicator,
SelectPopover,
ListBox,
ListBoxItem,
ListBoxItemIndicator,
Label,
} from "@heroui-vue/components";
</script>
<template>
<Select
class="w-[256px]"
:disabled-keys="['cat', 'kangaroo']"
placeholder="请选择动物"
>
<Label>动物</Label>
<SelectTrigger>
<SelectValue />
<SelectIndicator />
</SelectTrigger>
<SelectPopover>
<ListBox>
<ListBoxItem id="dog" text-value="狗">
狗
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="cat" text-value="猫">
猫
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="bird" text-value="鸟">
鸟
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="kangaroo" text-value="袋鼠">
袋鼠
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="elephant" text-value="大象">
大象
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="tiger" text-value="老虎">
老虎
<ListBoxItemIndicator />
</ListBoxItem>
</ListBox>
</SelectPopover>
</Select>
</template>