Skip to content

Commit 339b7d3

Browse files
committed
docs: add $route.name (close #202)
1 parent 97176ee commit 339b7d3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/en/route.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ A route object exposes the following properties:
2424

2525
An array containing the route configuration objects for all matched segments in the current route.
2626

27+
- **$route.name**
28+
29+
The name of the current route, if it has one. (See [named routes](./named.md))
30+
2731
### Custom Fields
2832

2933
In addition to the built-in properties, custom fields defined in the route config will also be merged on to the route object. For example:

docs/zh-cn/route.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Vue-router 做路径匹配时支持动态片段、全匹配片段以及查询参
2525

2626
数组,包含当前匹配的路径中所包含的所有片段所对应的配置参数对象。
2727

28+
- **$route.name**
29+
30+
当前路径的名字。 (参见[具名路径](./named.md))
31+
2832
### 自定义字段
2933

3034
除了以上这些内置的属性外,在路由设置对象中的其他自定义字段也会被拷贝到最终的路由对象上。例如:

0 commit comments

Comments
 (0)