Skip to content

Commit

Permalink
perf(guard): Add a tool function to handle the logic of TargetRouterV…
Browse files Browse the repository at this point in the history
…iewDepth
  • Loading branch information
Admin authored and Admin committed Feb 9, 2023
1 parent 7780592 commit 810e782
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/util/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function handleRouteEntered (route: Route) {
}
}

export function getTargetRouterViewDepth (target) {
export function getTargetRouterViewDepth (target: any) {
return target && target.$vnode && target.$vnode.data ? target.$vnode.data.routerViewDepth
: null
}
5 changes: 3 additions & 2 deletions types/router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,13 @@ interface RouteConfigMultipleViews extends _RouteConfigBase {
}

export type RouteConfig = RouteConfigSingleView | RouteConfigMultipleViews
export type VueInstance = Dictionary<Vue>

export interface RouteRecord {
path: string
regex: RegExp
components: Dictionary<Component>
instances: Dictionary<Vue>
instances: VueInstance
name?: string
parent?: RouteRecord
redirect?: RedirectOption
Expand All @@ -380,7 +381,7 @@ export interface RouteRecord {
export interface RouteRecordPublic {
path: string
components: Dictionary<Component>
instances: Dictionary<Vue>
instances: VueInstance
name?: string
redirect?: RedirectOption
meta: any
Expand Down

0 comments on commit 810e782

Please sign in to comment.