From: Matthias Sieber Date: Thu, 3 Jun 2021 09:50:36 +0000 (-0700) Subject: docs: add vue imports in code examples (#978) X-Git-Tag: v4.0.9~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c01a6ebf4b592d49740e124a693b0aaa1b88d74;p=thirdparty%2Fvuejs%2Frouter.git docs: add vue imports in code examples (#978) --- diff --git a/docs/guide/advanced/composition-api.md b/docs/guide/advanced/composition-api.md index d4daf1d6..c0b41d6a 100644 --- a/docs/guide/advanced/composition-api.md +++ b/docs/guide/advanced/composition-api.md @@ -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',