mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
42 lines
756 B
Vue
42 lines
756 B
Vue
<script setup lang="ts">
|
|
const items = ref([
|
|
{
|
|
label: 'bug',
|
|
value: 'bug',
|
|
chip: {
|
|
color: 'error' as const
|
|
}
|
|
},
|
|
{
|
|
label: 'feature',
|
|
value: 'feature',
|
|
chip: {
|
|
color: 'success' as const
|
|
}
|
|
},
|
|
{
|
|
label: 'enhancement',
|
|
value: 'enhancement',
|
|
chip: {
|
|
color: 'info' as const
|
|
}
|
|
}
|
|
])
|
|
const selected = ref(items.value[0])
|
|
</script>
|
|
|
|
<template>
|
|
<USelectMenu v-model="selected" :items="items" class="w-40">
|
|
<template #leading="{ modelValue, ui }">
|
|
<UChip
|
|
v-if="modelValue"
|
|
v-bind="modelValue.chip"
|
|
inset
|
|
standalone
|
|
:size="ui.itemLeadingChipSize()"
|
|
:class="ui.itemLeadingChip()"
|
|
/>
|
|
</template>
|
|
</USelectMenu>
|
|
</template>
|