Files
heroui-vue/apps/docs/demos/select-variants.vue
T

56 lines
1.4 KiB
Vue

<script setup lang="ts">
import {
Select,
SelectTrigger,
SelectValue,
SelectIndicator,
SelectPopover,
ListBox,
ListBoxItem,
ListBoxItemIndicator,
Label,
} from "@heroui-vue/components";
</script>
<template>
<div class="flex flex-col gap-4">
<Select class="w-[256px]" placeholder="请选择" variant="primary">
<Label>主要变体</Label>
<SelectTrigger>
<SelectValue />
<SelectIndicator />
</SelectTrigger>
<SelectPopover>
<ListBox>
<ListBoxItem id="option1" text-value="选项 1">
Option 1
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="option2" text-value="选项 2">
Option 2
<ListBoxItemIndicator />
</ListBoxItem>
</ListBox>
</SelectPopover>
</Select>
<Select class="w-[256px]" placeholder="请选择" variant="secondary">
<Label>次要变体</Label>
<SelectTrigger>
<SelectValue />
<SelectIndicator />
</SelectTrigger>
<SelectPopover>
<ListBox>
<ListBoxItem id="option1" text-value="选项 1">
Option 1
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="option2" text-value="选项 2">
Option 2
<ListBoxItemIndicator />
</ListBoxItem>
</ListBox>
</SelectPopover>
</Select>
</div>
</template>