Skip to content

Commit 03928bd

Browse files
committed
docs for router.onReady
1 parent 33eae50 commit 03928bd

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

docs/en/api/router-instance.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,9 @@
5959
> 2.2.0+
6060
6161
Dynamically add more routes to the router. The argument must be an Array using the same route config format with the `routes` constructor option.
62+
63+
- **router.onReady(callback)**
64+
65+
> 2.2.0+
66+
67+
Queue a callback to be called when the router has completed the initial navigation. This is useful when you need to wait until all asynchronous route enter hooks / async components have been resolved, e.g. in server-side rendering.

docs/zh-cn/api/router-instance.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,15 @@
5353
href: string;
5454
}
5555
```
56+
57+
- **router.addRoute(routes)**
58+
59+
> 2.2.0+
60+
61+
动态添加更多的路由规则。参数必须是一个符合 `routes` 选项要求的数组。
62+
63+
- **router.onReady(callback)**
64+
65+
> 2.2.0+
66+
67+
添加一个会在第一次路由跳转完成时被调用的回调函数。此方法通常用于等待异步的导航钩子完成,比如在进行服务端渲染的时候。

0 commit comments

Comments
 (0)