mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 02:10:40 +01:00
chore(VerticalNavigation): add Link type
This commit is contained in:
@@ -40,13 +40,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent } from 'vue'
|
import { computed, defineComponent } from 'vue'
|
||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
import type { RouteLocationRaw } from 'vue-router'
|
|
||||||
import { defu } from 'defu'
|
import { defu } from 'defu'
|
||||||
import { omit } from 'lodash-es'
|
import { omit } from 'lodash-es'
|
||||||
import UIcon from '../elements/Icon.vue'
|
import UIcon from '../elements/Icon.vue'
|
||||||
import UAvatar from '../elements/Avatar.vue'
|
import UAvatar from '../elements/Avatar.vue'
|
||||||
import ULinkCustom from '../elements/LinkCustom.vue'
|
import ULinkCustom from '../elements/LinkCustom.vue'
|
||||||
import type { Avatar } from '../../types/avatar'
|
import type { Link } from '../../types/vertical-navigation'
|
||||||
import { useAppConfig } from '#imports'
|
import { useAppConfig } from '#imports'
|
||||||
// TODO: Remove
|
// TODO: Remove
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
@@ -62,16 +61,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
links: {
|
links: {
|
||||||
type: Array as PropType<{
|
type: Array as PropType<Link[]>,
|
||||||
to?: string | RouteLocationRaw
|
|
||||||
exact?: boolean
|
|
||||||
label: string
|
|
||||||
icon?: string
|
|
||||||
iconClass?: string
|
|
||||||
avatar?: Partial<Avatar>
|
|
||||||
click?: Function
|
|
||||||
badge?: string | number
|
|
||||||
}[]>,
|
|
||||||
default: () => []
|
default: () => []
|
||||||
},
|
},
|
||||||
ui: {
|
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 './command-palette'
|
||||||
export * from './notification'
|
export * from './notification'
|
||||||
export * from './popper'
|
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