docs(vertical-navigation): simplify default slot example

Resolves #813
This commit is contained in:
Benjamin Canac
2023-10-27 22:27:42 +02:00
parent 18e8d28272
commit a0ffd3e334

View File

@@ -1,31 +1,20 @@
<script setup>
const links = [{
label: 'Navigation',
children: [{
label: 'Vertical Navigation',
to: '/navigation/vertical-navigation'
}, {
label: 'Command Palette',
to: '/navigation/command-palette'
}]
label: 'Vertical Navigation',
to: '/navigation/vertical-navigation'
}, {
label: 'Data',
children: [{
label: 'Table',
to: '/data/table'
}]
label: 'Command Palette',
to: '/navigation/command-palette'
}, {
label: 'Table',
to: '/data/table'
}]
</script>
<template>
<UVerticalNavigation :links="links">
<template #default="{ link }">
<div class="relative text-left w-full">
<div class="mb-2">
{{ link.label }}
</div>
<UVerticalNavigation v-if="link.children" :links="link.children" />
</div>
<span class="group-hover:text-primary relative">{{ link.label }}</span>
</template>
</UVerticalNavigation>
</template>