From: Matthias Sommer Date: Wed, 20 Apr 2022 13:40:34 +0000 (+0200) Subject: docs: improve meta extending (#1360) X-Git-Tag: v4.0.15~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abc918f964abf08f07f43e4abc9c1f36f4cfeabd;p=thirdparty%2Fvuejs%2Frouter.git docs: improve meta extending (#1360) Co-authored-by: Eduardo San Martin Morote --- diff --git a/docs/guide/advanced/meta.md b/docs/guide/advanced/meta.md index 8b3af93e..cfd9c11e 100644 --- a/docs/guide/advanced/meta.md +++ b/docs/guide/advanced/meta.md @@ -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' {