]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: mention useRouter for programmatic navigation (#2070)
authorskirtle <65301168+skirtles-code@users.noreply.github.com>
Thu, 7 Dec 2023 09:51:20 +0000 (09:51 +0000)
committerGitHub <noreply@github.com>
Thu, 7 Dec 2023 09:51:20 +0000 (10:51 +0100)
packages/docs/guide/essentials/navigation.md

index 602ebb6f7efee735cffdd43c66b856b95fa8165a..70a8131b4c2f054585f437128f9f130d652b2e3a 100644 (file)
@@ -13,7 +13,7 @@ Aside from using `<router-link>` to create anchor tags for declarative navigatio
 
 ## Navigate to a different location
 
-**Note: Inside of a Vue instance, you have access to the router instance as `$router`. You can therefore call `this.$router.push`.**
+**Note: The examples below refer to the router instance as `router`. Inside a component, you can access the router using the `$router` property, e.g. `this.$router.push(...)`. If you're using the Composition API, the router is accessible by calling [`useRouter()`](../advanced/composition-api).**
 
 To navigate to a different URL, use `router.push`. This method pushes a new entry into the history stack, so when the user clicks the browser back button they will be taken to the previous URL.