File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ type Dictionary<T> = { [key: string]: T };
6
6
export type RouterMode = "hash" | "history" | "abstract" ;
7
7
export type RawLocation = string | Location ;
8
8
export type RedirectOption = RawLocation | ( ( to : Route ) => RawLocation ) ;
9
- export type NavigationGuard = (
9
+ export type NavigationGuard < V extends Vue = Vue > = (
10
10
to : Route ,
11
11
from : Route ,
12
- next : ( to ?: RawLocation | false | ( ( vm : Vue ) => any ) | void ) => void
12
+ next : ( to ?: RawLocation | false | ( ( vm : V ) => any ) | void ) => void
13
13
) => any
14
14
15
15
export declare class VueRouter {
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ declare module "vue/types/vue" {
15
15
declare module "vue/types/options" {
16
16
interface ComponentOptions < V extends Vue > {
17
17
router ?: VueRouter ;
18
- beforeRouteEnter ?: NavigationGuard ;
19
- beforeRouteLeave ?: NavigationGuard ;
20
- beforeRouteUpdate ?: NavigationGuard ;
18
+ beforeRouteEnter ?: NavigationGuard < V > ;
19
+ beforeRouteLeave ?: NavigationGuard < V > ;
20
+ beforeRouteUpdate ?: NavigationGuard < V > ;
21
21
}
22
22
}
You can’t perform that action at this time.
0 commit comments