mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
chore(VerticalNavigation): add Link type
This commit is contained in:
@@ -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: {
|
||||
|
||||
1
src/runtime/types/index.d.ts
vendored
1
src/runtime/types/index.d.ts
vendored
@@ -4,3 +4,4 @@ export * from './clipboard'
|
||||
export * from './command-palette'
|
||||
export * from './notification'
|
||||
export * from './popper'
|
||||
export * from './vertical-navigation'
|
||||
|
||||
13
src/runtime/types/vertical-navigation.d.ts
vendored
Normal file
13
src/runtime/types/vertical-navigation.d.ts
vendored
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user