File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
packages/docs/guide/advanced Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,16 @@ const routes = [
1717 path: ' new' ,
1818 component: PostsNew,
1919 // only authenticated users can create posts
20- meta: { requiresAuth: true }
20+ meta: { requiresAuth: true },
2121 },
2222 {
2323 path: ' :id' ,
2424 component: PostsDetail,
2525 // anybody can read a post
26- meta: { requiresAuth: false }
27- }
28- ]
29- }
26+ meta: { requiresAuth: false },
27+ },
28+ ],
29+ },
3030]
3131```
3232
@@ -62,12 +62,13 @@ It is possible to type the meta field by extending the `RouteMeta` interface fro
6262
6363``` ts
6464// 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"
6967import ' vue-router'
7068
69+ // To ensure it is treated as a module, add at least one `export` statement
70+ export {}
71+
7172declare module ' vue-router' {
7273 interface RouteMeta {
7374 // is optional
You can’t perform that action at this time.
0 commit comments