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

39 lines
1.0 KiB
Vue

<script setup lang="ts">
import {
Select,
SelectTrigger,
SelectValue,
SelectIndicator,
SelectPopover,
ListBox,
ListBoxItem,
ListBoxItemIndicator,
Label,
} from "@heroui-vue/components";
const itemClass =
"rounded-lg data-[focused=true]:bg-accent/10 data-[selected=true]:text-foreground";
</script>
<template>
<Select class="w-56" placeholder="选择套餐" variant="secondary">
<Label class="font-medium text-foreground">套餐</Label>
<SelectTrigger class="rounded-xl bg-default">
<SelectValue />
<SelectIndicator />
</SelectTrigger>
<SelectPopover
class="rounded-xl border border-border bg-surface p-1 shadow-lg"
>
<ListBox>
<ListBoxItem :class="itemClass" id="free" text-value="免费">
免费
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem :class="itemClass" id="pro" text-value="专业版">
专业版
<ListBoxItemIndicator />
</ListBoxItem>
</ListBox>
</SelectPopover>
</Select>
</template>