File tree 1 file changed +10
-9
lines changed
packages/docs/guide/advanced
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,16 @@ const routes = [
17
17
path: ' new' ,
18
18
component: PostsNew,
19
19
// only authenticated users can create posts
20
- meta: { requiresAuth: true }
20
+ meta: { requiresAuth: true },
21
21
},
22
22
{
23
23
path: ' :id' ,
24
24
component: PostsDetail,
25
25
// anybody can read a post
26
- meta: { requiresAuth: false }
27
- }
28
- ]
29
- }
26
+ meta: { requiresAuth: false },
27
+ },
28
+ ],
29
+ },
30
30
]
31
31
```
32
32
@@ -62,12 +62,13 @@ It is possible to type the meta field by extending the `RouteMeta` interface fro
62
62
63
63
``` ts
64
64
// This can be directly added to any of your `.ts` files like `router.ts`
65
- // It can also be added to a `.d.ts` file, in which case you will need to add an export
66
- // to ensure it is treated as a module
67
- export {}
68
-
65
+ // It can also be added to a `.d.ts` file. Make sure it's included in
66
+ // project's tsconfig.json "files"
69
67
import ' vue-router'
70
68
69
+ // To ensure it is treated as a module, add at least one `export` statement
70
+ export {}
71
+
71
72
declare module ' vue-router' {
72
73
interface RouteMeta {
73
74
// is optional
You can’t perform that action at this time.
0 commit comments