]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: plugin typescript for vue-router (#1963)
authorEduardo San Martin Morote <posva@users.noreply.github.com>
Mon, 30 Jan 2023 10:04:15 +0000 (11:04 +0100)
committerEduardo San Martin Morote <posva@users.noreply.github.com>
Wed, 15 Feb 2023 09:52:57 +0000 (10:52 +0100)
Co-authored-by: Yoshi Otobe <38850403+yoshiotobe@users.noreply.github.com>
packages/docs/core-concepts/plugins.md

index ba87ba37c618d369c3af53df8e59ed066abd63fd..2048ef7d4280c7519ffe1a1d543dd2ff573aa18c 100644 (file)
@@ -269,6 +269,7 @@ When adding new properties to stores, you should also extend the `PiniaCustomPro
 
 ```ts
 import 'pinia'
+import type { Router } from 'vue-router'
 
 declare module 'pinia' {
   export interface PiniaCustomProperties {
@@ -278,6 +279,9 @@ declare module 'pinia' {
 
     // you can define simpler values too
     simpleNumber: number
+
+    // type the router added by the plugin above (#adding-new-external-properties)
+    router: Router
   }
 }
 ```