Skip to content

Commit d794785

Browse files
committed
docs: getting started
1 parent 26ba22d commit d794785

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

docs/en/SUMMARY.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
- [Installation](installation.md)
77
- Essentials
88
- [Getting Started](essentials/getting-started.md)
9-
- [Navigating with Links](essentials/links.md)
109
- [Nested Routes](essentials/nested-routes.md)
1110
- [Redirect and Alias](essentials/redirect-and-alias.md)
1211
- [Programmatic Navigation](essentials/navigation.md)
@@ -19,11 +18,11 @@
1918
- [Scroll Behavior](advanced/scroll-behavior.md)
2019
- [Lazy Loading](advanced/lazy-loading.md)
2120
- API Reference
21+
- [router-link](api/router-link.md)
22+
- [router-view](api/router-view.md)
2223
- [Router Constructor Options](api/options.md)
2324
- [Route Config Options](api/route-config.md)
24-
- [Route Matching Rules](api/matching.md)
2525
- [Router Instance](api/router-instance.md)
2626
- [The $route Object](api/route-object.md)
27-
- [Component Navigation Hooks](api/component-hooks.md)
28-
- [router-link](api/router-link.md)
29-
- [router-view](api/router-view.md)
27+
- [Component Route Hooks](api/component-hooks.md)
28+
- [Route Matching Rules](api/matching.md)

docs/en/essentials/getting-started.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Basic Usage
1+
# Getting Started
22

33
Creating a Single-page Application with Vue.js + vue-router is dead simple. With Vue.js, we are already dividing our application into components. When adding vue-router to the mix, all we need to do is map our components to the routes and let vue-router know where to render them. Here's a basic example:
44

@@ -11,10 +11,11 @@ Creating a Single-page Application with Vue.js + vue-router is dead simple. With
1111
<!-- use router-link component for navigation. -->
1212
<!-- specify the link by passing the `to` prop. -->
1313
<!-- <router-link> will be rendered as an `<a>` tag by default -->
14-
<router-link :to="{ path: '/foo' }">Go to Foo</router-link>
14+
<router-link to="/foo">Go to Foo</router-link>
1515
<router-link to="/bar">Go to Bar</router-link>
1616
</p>
1717
<!-- route outlet -->
18+
<!-- component matched by the route will render here -->
1819
<router-view></router-view>
1920
</div>
2021
```
@@ -27,7 +28,8 @@ Creating a Single-page Application with Vue.js + vue-router is dead simple. With
2728
// and injects $router and $route to all router-enabled child components
2829
Vue.use(VueRouter)
2930

30-
// 2. Define route components
31+
// 2. Define route components.
32+
// These can be imported from other files
3133
var Foo = { template: '<div>foo</div>' }
3234
var Bar = { template: '<div>bar</div>' }
3335

@@ -49,21 +51,21 @@ var router = new VueRouter({
4951
})
5052

5153
// 5. Create and mount the root instance.
52-
// Make sure to inject the router.
53-
// Route components will be rendered inside <router-view>.
54-
// The root instance will mount to
55-
// the element matching the selector #app.
54+
// Make sure to inject the router with the router option to make the
55+
// whole app router-aware.
5656
new Vue({
5757
router: router
5858
}).$mount('#app')
5959

6060
// Now the app has started!
6161
```
6262

63-
You can also checkout this example [live](http://jsfiddle.net/fnlCtrl/t49c0mqz/).
63+
You can also checkout this example [live](http://jsfiddle.net/yyx990803/xgrjzsup/).
6464

6565
In addition:
6666

67-
- The root Vue instance will be available as `router.app` once the initial render is complete.
67+
- Notice that a `<router-link>` automatically gets the `.router-link-active` class when its target route is matched. You can learn more about it in its [API reference](../api/router-link.md).
6868

69-
- The router instance will be available in all descendants of the root instance as `this.$router`.
69+
- The root Vue instance will be available as `router.app` once the initial render is complete. You can learn more about the properties and methods available on the router instance [here](../api/router-instance.md).
70+
71+
- The router instance will be available in all descendants of the root instance as `this.$router`. An object representing the current route state will also be available as [this.$route](../api/route-object.md).

docs/en/essentials/links.md

Whitespace-only changes.

0 commit comments

Comments
 (0)