Files
nuxt__ui/docs/app/components/content/examples/select-menu/SelectMenuItemsAvatarExample.vue

49 lines
981 B
Vue

<script setup lang="ts">
import type { SelectMenuItem } from '@nuxt/ui'
const items = ref([
{
label: 'benjamincanac',
value: 'benjamincanac',
avatar: {
src: 'https://github.com/benjamincanac.png',
alt: 'benjamincanac',
loading: 'lazy' as const
}
},
{
label: 'romhml',
value: 'romhml',
avatar: {
src: 'https://github.com/romhml.png',
alt: 'romhml',
loading: 'lazy' as const
}
},
{
label: 'noook',
value: 'noook',
avatar: {
src: 'https://github.com/noook.png',
alt: 'noook',
loading: 'lazy' as const
}
},
{
label: 'sandros94',
value: 'sandros94',
avatar: {
src: 'https://github.com/sandros94.png',
alt: 'sandros94',
loading: 'lazy' as const
}
}
] satisfies SelectMenuItem[])
const value = ref(items.value[0])
</script>
<template>
<USelectMenu v-model="value" :avatar="value?.avatar" :items="items" class="w-48" />
</template>