]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: improve meta extending (#1360)
authorMatthias Sommer <matthiassommer@posteo.de>
Wed, 20 Apr 2022 13:40:34 +0000 (15:40 +0200)
committerGitHub <noreply@github.com>
Wed, 20 Apr 2022 13:40:34 +0000 (15:40 +0200)
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
docs/guide/advanced/meta.md

index 8b3af93ef2dc36e4fcc4afdd9d6c625a1b1224a6..cfd9c11e3a2ca69cb38834208f4f6a7636d02ba2 100644 (file)
@@ -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' {