From e33289c69d3bc6f7f7eeb24ea697509791d24ed1 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 4 Apr 2017 11:57:37 +0200 Subject: [PATCH 1/2] Add note about $router in navigation Closes #1136 --- docs/en/essentials/navigation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/essentials/navigation.md b/docs/en/essentials/navigation.md index 55f7dbb86..59165d492 100644 --- a/docs/en/essentials/navigation.md +++ b/docs/en/essentials/navigation.md @@ -4,6 +4,8 @@ Aside from using `` to create anchor tags for declarative navigatio #### `router.push(location, onComplete?, onAbort?)` +_Note_: Inside of a Vue instance, you have access to the router instance as `$router`. You can therefore call `this.$router.push`. + 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. This is the method called internally when you click a ``, so clicking `` is the equivalent of calling `router.push(...)`. From a8d6e113a0d37f3cfd1e32f3e72cb2addfc5eb6c Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 4 Apr 2017 11:59:02 +0200 Subject: [PATCH 2/2] Update navigation.md --- docs/en/essentials/navigation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/essentials/navigation.md b/docs/en/essentials/navigation.md index 59165d492..d2a08eb99 100644 --- a/docs/en/essentials/navigation.md +++ b/docs/en/essentials/navigation.md @@ -4,7 +4,7 @@ Aside from using `` to create anchor tags for declarative navigatio #### `router.push(location, onComplete?, onAbort?)` -_Note_: Inside of a Vue instance, you have access to the router instance as `$router`. You can therefore call `this.$router.push`. +**Note: Inside of a Vue instance, you have access to the router instance as `$router`. You can therefore call `this.$router.push`.** 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.