Skip to content

Commit 9e4aa54

Browse files
Jinjiangposva
authored andcommitted
docs(zh-cn): synced udpates and some typos (#2087)
* [docs][zh-cn] synced udpates and some typos * Update route-object.md * Update route-object.md * Update route-object.md
1 parent 7429a73 commit 9e4aa54

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

Diff for: docs/zh-cn/SUMMARY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- [编程式导航](essentials/navigation.md)
1313
- [命名路由](essentials/named-routes.md)
1414
- [命名视图](essentials/named-views.md)
15-
- [重定向 和 别名](essentials/redirect-and-alias.md)
15+
- [重定向和别名](essentials/redirect-and-alias.md)
1616
- [向路由组件传递 props](essentials/passing-props.md)
1717
- [HTML5 History 模式](essentials/history-mode.md)
1818
- 进阶

Diff for: docs/zh-cn/api/route-object.md

+15-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# 路由信息对象
22

3-
一个 **route object(路由信息对象)** 表示当前激活的路由的状态信息,包含了当前 URL 解析得到的信息,还有 URL 匹配到的 **route records(路由记录)**
3+
一个**路由对象 (route object)** 表示当前激活的路由的状态信息,包含了当前 URL 解析得到的信息,还有 URL 匹配到的**路由记录 (route records)**
44

5-
route object 是 immutable(不可变) 的,每次成功的导航后都会产生一个新的对象。
5+
路由对象是不可变 (immutable) 的,每次成功的导航后都会产生一个新的对象。
66

7-
route object 出现在多个地方:
7+
路由对象出现在多个地方:
88

99
- 在组件内,即 `this.$route`
1010

@@ -16,7 +16,7 @@ route object 出现在多个地方:
1616

1717
``` js
1818
router.beforeEach((to, from, next) => {
19-
// to 和 from 都是 路由信息对象
19+
// `to``from` 都是路由对象
2020
})
2121
```
2222

@@ -25,7 +25,7 @@ route object 出现在多个地方:
2525
``` js
2626
const router = new VueRouter({
2727
scrollBehavior (to, from, savedPosition) {
28-
// to 和 from 都是 路由信息对象
28+
     // `to``from` 都是路由对象
2929
}
3030
})
3131
```
@@ -42,7 +42,7 @@ route object 出现在多个地方:
4242

4343
- 类型: `Object`
4444

45-
一个 key/value 对象,包含了 动态片段 和 全匹配片段,如果没有路由参数,就是一个空对象。
45+
一个 key/value 对象,包含了动态片段和全匹配片段,如果没有路由参数,就是一个空对象。
4646

4747
- **$route.query**
4848

@@ -66,24 +66,28 @@ route object 出现在多个地方:
6666

6767
- 类型: `Array<RouteRecord>`
6868

69-
一个数组,包含当前路由的所有嵌套路径片段的 **路由记录** 。路由记录就是 `routes` 配置数组中的对象副本还有在 `children` 数组
69+
一个数组,包含当前路由的所有嵌套路径片段的**路由记录** 。路由记录就是 `routes` 配置数组中的对象副本 (还有在 `children` 数组)
7070

7171
``` js
7272
const router = new VueRouter({
7373
routes: [
74-
// 下面的对象就是 route record
74+
// 下面的对象就是路由记录
7575
{ path: '/foo', component: Foo,
7676
children: [
77-
// 这也是个 route record
77+
// 这也是个路由记录
7878
{ path: 'bar', component: Bar }
7979
]
8080
}
8181
]
8282
})
8383
```
8484

85-
当 URL 为 `/foo/bar``$route.matched` 将会是一个包含从上到下的所有对象(副本)
85+
当 URL 为 `/foo/bar``$route.matched` 将会是一个包含从上到下的所有对象 (副本)
8686

8787
- **$route.name**
8888

89-
当前路由的名称,如果有的话。(查看 [命名路由](../essentials/named-routes.md)
89+
当前路由的名称,如果有的话。(查看[命名路由](../essentials/named-routes.md))
90+
91+
- **$route.redirectedFrom**
92+
93+
如果存在重定向,即为重定向来源的路由的名字。(参阅[重定向和别名](../essentials/redirect-and-alias.md))

Diff for: docs/zh-cn/essentials/redirect-and-alias.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 重定向 和 别名
1+
# 重定向和别名
22

33
### 重定向
44

0 commit comments

Comments
 (0)