]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: show store
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 11 May 2023 10:58:27 +0000 (12:58 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 11 May 2023 10:59:09 +0000 (12:59 +0200)
packages/docs/guide/advanced/navigation-guards.md

index 865031acef84c84ffc0fefcf91e577fb2cf5d913..65c2532f07e66ba6c2be05a16a0c2d6192cb2270 100644 (file)
@@ -145,7 +145,10 @@ app.provide('global', 'hello injections')
 
 // router.ts or main.ts
 router.beforeEach((to, from) => {
-  console.log(inject('global')) // -> 'hello injections'
+  const global = inject('global') // 'hello injections'
+  // a pinia store
+  const userStore = useAuthStore()
+  // ...
 })
 ```