Skip to content

Commit

Permalink
docs: format
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jun 14, 2023
1 parent 1a2766b commit 957c6e7
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions packages/docs/guide/advanced/meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ const routes = [
path: 'new',
component: PostsNew,
// only authenticated users can create posts
meta: { requiresAuth: true }
meta: { requiresAuth: true },
},
{
path: ':id',
component: PostsDetail,
// anybody can read a post
meta: { requiresAuth: false }
}
]
}
meta: { requiresAuth: false },
},
],
},
]
```

Expand Down Expand Up @@ -62,12 +62,13 @@ It is possible to type the meta field by extending the `RouteMeta` interface fro

```ts
// This can be directly added to any of your `.ts` files like `router.ts`
// It can also be added to a `.d.ts` file, in which case you will need to add an export
// to ensure it is treated as a module
export {}

// It can also be added to a `.d.ts` file. Make sure it's included in
// project's tsconfig.json "files"
import 'vue-router'

// To ensure it is treated as a module, add at least one `export` statement
export {}

declare module 'vue-router' {
interface RouteMeta {
// is optional
Expand Down

0 comments on commit 957c6e7

Please sign in to comment.