docs(VerticalNavigation): add slots examples (#456)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
KeJun
2023-07-30 22:12:41 +08:00
committed by GitHub
parent 5221294f78
commit 8e1aa2f1b6
6 changed files with 331 additions and 7 deletions

View File

@@ -0,0 +1,31 @@
<script setup>
const links = [{
label: 'Navigation',
children: [{
label: 'Vertical Navigation',
to: '/navigation/vertical-navigation'
}, {
label: 'Command Palette',
to: '/navigation/command-palette'
}]
}, {
label: 'Data',
children: [{
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>
</template>
</UVerticalNavigation>
</template>