From a79f7c0a34c0414fe4feb95691e1f044b07ef087 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 12 Dec 2023 19:11:12 +0100 Subject: [PATCH] feat(VerticalNavigation): handle `labelClass` and merge `iconClass` --- docs/content/5.navigation/1.vertical-navigation.md | 3 ++- .../components/navigation/VerticalNavigation.vue | 11 +++++++---- src/runtime/types/vertical-navigation.d.ts | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/content/5.navigation/1.vertical-navigation.md b/docs/content/5.navigation/1.vertical-navigation.md index 6fa52a1433..c487e38764 100644 --- a/docs/content/5.navigation/1.vertical-navigation.md +++ b/docs/content/5.navigation/1.vertical-navigation.md @@ -12,8 +12,9 @@ links: Pass an array to the `links` prop of the VerticalNavigation component. Each link can have the following properties: - `label` - The label of the link. +- `labelClass` - The class of the link label. :u-badge{label="New" class="!rounded-full" variant="subtle"} - `icon` - The icon of the link. -- `iconClass` - The class of the icon link. +- `iconClass` - The class of the link icon. - `avatar` - The avatar of the link. You can pass all the props of the [Avatar](/elements/avatar) component. - `badge` - A badge to display next to the label. - `click` - The click handler of the link. diff --git a/src/runtime/components/navigation/VerticalNavigation.vue b/src/runtime/components/navigation/VerticalNavigation.vue index 48f3bbe8f3..c0f58b9033 100644 --- a/src/runtime/components/navigation/VerticalNavigation.vue +++ b/src/runtime/components/navigation/VerticalNavigation.vue @@ -4,7 +4,7 @@ v-for="(link, index) of links" v-slot="{ isActive }" :key="index" - v-bind="omit(link, ['label', 'icon', 'iconClass', 'avatar', 'badge', 'click'])" + v-bind="omit(link, ['label', 'labelClass', 'icon', 'iconClass', 'avatar', 'badge', 'click'])" :class="[ui.base, ui.padding, ui.width, ui.ring, ui.rounded, ui.font, ui.size]" :active-class="ui.active" :inactive-class="ui.inactive" @@ -22,11 +22,11 @@ - {{ link.label }} + {{ link.label }} @@ -40,6 +40,7 @@