Files
heroui-vue/apps/docs/demos/select-custom-indicator.vue
T

54 lines
1.4 KiB
Vue

<script setup lang="ts">
import {
Select,
SelectTrigger,
SelectValue,
SelectIndicator,
SelectPopover,
ListBox,
ListBoxItem,
ListBoxItemIndicator,
Label,
} from "@heroui-vue/components";
import { IconSelector } from "@tabler/icons-vue";
</script>
<template>
<Select class="w-[256px]" placeholder="请选择">
<Label>州</Label>
<SelectTrigger>
<SelectValue />
<SelectIndicator class="size-3">
<IconSelector />
</SelectIndicator>
</SelectTrigger>
<SelectPopover>
<ListBox>
<ListBoxItem id="florida" text-value="佛罗里达">
佛罗里达
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="delaware" text-value="特拉华">
特拉华
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="california" text-value="加利福尼亚">
加利福尼亚
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="texas" text-value="德克萨斯">
德克萨斯
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="new-york" text-value="纽约">
纽约
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="washington" text-value="华盛顿">
华盛顿
<ListBoxItemIndicator />
</ListBoxItem>
</ListBox>
</SelectPopover>
</Select>
</template>