chore(VerticalNavigation): add Link type

This commit is contained in:
Benjamin Canac
2023-07-12 18:43:45 +02:00
parent d15e8163e7
commit 7e08e5b024
3 changed files with 16 additions and 12 deletions

View File

@@ -40,13 +40,12 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import type { RouteLocationRaw } from 'vue-router'
import { defu } from 'defu'
import { omit } from 'lodash-es'
import UIcon from '../elements/Icon.vue'
import UAvatar from '../elements/Avatar.vue'
import ULinkCustom from '../elements/LinkCustom.vue'
import type { Avatar } from '../../types/avatar'
import type { Link } from '../../types/vertical-navigation'
import { useAppConfig } from '#imports'
// TODO: Remove
// @ts-expect-error
@@ -62,16 +61,7 @@ export default defineComponent({
},
props: {
links: {
type: Array as PropType<{
to?: string | RouteLocationRaw
exact?: boolean
label: string
icon?: string
iconClass?: string
avatar?: Partial<Avatar>
click?: Function
badge?: string | number
}[]>,
type: Array as PropType<Link[]>,
default: () => []
},
ui: {

View File

@@ -4,3 +4,4 @@ export * from './clipboard'
export * from './command-palette'
export * from './notification'
export * from './popper'
export * from './vertical-navigation'

View File

@@ -0,0 +1,13 @@
import type { RouteLocationRaw } from 'vue-router'
import type { Avatar } from './avatar'
export interface Link {
to?: string | RouteLocationRaw
exact?: boolean
label: string
icon?: string
iconClass?: string
avatar?: Partial<Avatar>
click?: Function
badge?: string | number
}