Skip to content

Commit f151ded

Browse files
committed
docs($router): Chris review
1 parent 53593c7 commit f151ded

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/en/essentials/getting-started.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,22 @@ By injecting the router, we get access to it as `this.$router` as well as the cu
7070
// Home.vue
7171
export default {
7272
computed: {
73-
params () {
73+
username () {
7474
// We will see what params are shortly
75-
return this.$route.params
75+
return this.$route.params.username
7676
}
7777
},
7878
methods: {
79-
someMethod () {
80-
// Redirecting to another route
81-
this.$router.push('/redirect')
79+
goBack () {
80+
window.history.length > 1
81+
? this.$router.go(-1)
82+
: this.$router.push('/')
8283
}
84+
}
8385
}
8486
```
8587

86-
Thoroughly the docs, we will often use the `router` instance. Keep in mind that `this.$router` is exactly the same as using `router`. The reason we use `this.$router` is because we don't want to import the router in every single component that needs to manipulate routing.
88+
Throughout the docs, we will often use the `router` instance. Keep in mind that `this.$router` is exactly the same as using `router`. The reason we use `this.$router` is because we don't want to import the router in every single component that needs to manipulate routing.
8789

8890
You can also checkout this example [live](http://jsfiddle.net/yyx990803/xgrjzsup/).
8991

0 commit comments

Comments
 (0)