Skip to content

Commit e768e4a

Browse files
posvayyx990803
authored andcommitted
Add note about $router in navigation (#1304)
* Add note about $router in navigation Closes #1136 * Update navigation.md
1 parent 702f901 commit e768e4a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/en/essentials/navigation.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Aside from using `<router-link>` to create anchor tags for declarative navigatio
44

55
#### `router.push(location, onComplete?, onAbort?)`
66

7+
**Note: Inside of a Vue instance, you have access to the router instance as `$router`. You can therefore call `this.$router.push`.**
8+
79
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.
810

911
This is the method called internally when you click a `<router-link>`, so clicking `<router-link :to="...">` is the equivalent of calling `router.push(...)`.

0 commit comments

Comments
 (0)