chore(Breadcrumb): chore(VerticalNavigation): use getULinkProps to bind links

This commit is contained in:
Benjamin Canac
2024-01-11 12:17:49 +01:00
parent 4c9c8d343a
commit 5c759c326d

View File

@@ -5,7 +5,7 @@
<ULink <ULink
as="span" as="span"
:class="[ui.base, index === links.length - 1 ? ui.active : !!link.to ? ui.inactive : '']" :class="[ui.base, index === links.length - 1 ? ui.active : !!link.to ? ui.inactive : '']"
v-bind="omit(link, ['label', 'labelClass', 'icon', 'iconClass'])" v-bind="getULinkProps(link)"
:aria-current="index === links.length - 1 ? 'page' : undefined" :aria-current="index === links.length - 1 ? 'page' : undefined"
> >
<slot name="icon" :link="link" :index="index" :is-active="index === links.length - 1"> <slot name="icon" :link="link" :index="index" :is-active="index === links.length - 1">
@@ -39,7 +39,7 @@ import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue' import UIcon from '../elements/Icon.vue'
import ULink from '../elements/Link.vue' import ULink from '../elements/Link.vue'
import { useUI } from '../../composables/useUI' import { useUI } from '../../composables/useUI'
import { mergeConfig, omit } from '../../utils' import { mergeConfig, getULinkProps } from '../../utils'
import type { BreadcrumbLink, Strategy } from '../../types' import type { BreadcrumbLink, Strategy } from '../../types'
// @ts-expect-error // @ts-expect-error
import appConfig from '#build/app.config' import appConfig from '#build/app.config'
@@ -78,7 +78,7 @@ export default defineComponent({
// eslint-disable-next-line vue/no-dupe-keys // eslint-disable-next-line vue/no-dupe-keys
ui, ui,
attrs, attrs,
omit, getULinkProps,
twMerge, twMerge,
twJoin twJoin
} }