feat(Tabs): handle icon in items (#1798)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Abel Derderian
2024-07-23 14:36:03 +02:00
committed by GitHub
parent 839bf72c61
commit e8eb3941ad
11 changed files with 61 additions and 8 deletions

View File

@@ -17,13 +17,7 @@ const items = [{
<template>
<UTabs :items="items" class="w-full">
<template #default="{ item, index, selected }">
<div class="flex items-center gap-2 relative truncate">
<UIcon :name="item.icon" class="w-4 h-4 flex-shrink-0" />
<span class="truncate">{{ index + 1 }}. {{ item.label }}</span>
<span v-if="selected" class="absolute -right-4 w-2 h-2 rounded-full bg-primary-500 dark:bg-primary-400" />
</div>
<span class="truncate" :class="[selected && 'text-primary-500 dark:text-primary-400']">{{ index + 1 }}. {{ item.label }}</span>
</template>
</UTabs>
</template>