Skip to content

Commit

Permalink
docs: improve meta extending (#1360)
Browse files Browse the repository at this point in the history
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
  • Loading branch information
matthiassommer and posva committed Apr 20, 2022
1 parent e919c1d commit abc918f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/guide/advanced/meta.md
Expand Up @@ -58,10 +58,14 @@ router.beforeEach((to, from) => {

## TypeScript

It is possible to type the meta field by extending the `RouteMeta` interface:
It is possible to type the meta field by extending the `RouteMeta` interface from `vue-router`:

```ts
// typings.d.ts or router.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 {}

import 'vue-router'

declare module 'vue-router' {
Expand Down

0 comments on commit abc918f

Please sign in to comment.