]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: add vue imports in code examples (#978)
authorMatthias Sieber <manonthemat@users.noreply.github.com>
Thu, 3 Jun 2021 09:50:36 +0000 (02:50 -0700)
committerGitHub <noreply@github.com>
Thu, 3 Jun 2021 09:50:36 +0000 (11:50 +0200)
docs/guide/advanced/composition-api.md

index d4daf1d60da9f4231cdd5da7f63aa163c3c9307d..c0b41d6a3dddc260e86dcba5b77f9ff2c2a21b0f 100644 (file)
@@ -30,6 +30,7 @@ The `route` object is a reactive object, so any of its properties can be watched
 
 ```js
 import { useRoute } from 'vue-router'
+import { ref } from 'vue'
 
 export default {
   setup() {
@@ -55,6 +56,7 @@ While you can still use in-component navigation guards with a `setup` function,
 
 ```js
 import { onBeforeRouteLeave, onBeforeRouteUpdate } from 'vue-router'
+import { ref } from 'vue'
 
 export default {
   setup() {
@@ -88,6 +90,7 @@ Vue Router exposes the internal behavior of RouterLink as a Composition API func
 
 ```js
 import { RouterLink, useLink } from 'vue-router'
+import { computed } from 'vue'
 
 export default {
   name: 'AppLink',