Skip to content

Commit 957c6e7

Browse files
committed
docs: format
1 parent 1a2766b commit 957c6e7

File tree

1 file changed

+10
-9
lines changed
  • packages/docs/guide/advanced

1 file changed

+10
-9
lines changed

packages/docs/guide/advanced/meta.md

+10-9
Original file line numberDiff line numberDiff 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"
6967
import 'vue-router'
7068

69+
// To ensure it is treated as a module, add at least one `export` statement
70+
export {}
71+
7172
declare module 'vue-router' {
7273
interface RouteMeta {
7374
// is optional

0 commit comments

Comments
 (0)