Skip to content

Commit aad0d48

Browse files
authored
docs: incorrect description of content in the dynamic-routing section (#2413)
1 parent 2370820 commit aad0d48

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: packages/docs/guide/advanced/dynamic-routing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ router.beforeEach(to => {
5050
})
5151
```
5252

53-
The example above assumes two things: first, the newly added route record will match the `to` location, effectively resulting in a different location from the one we were trying to access. Second, `hasNecessaryRoute()` returns `false` after adding the new route to avoid an infinite redirection.
53+
The example above assumes two things: first, the newly added route record will match the `to` location, effectively resulting in a different location from the one we were trying to access. Second, `hasNecessaryRoute()` returns `true` after adding the new route to avoid an infinite redirection.
5454

5555
Because we are redirecting, we are replacing the ongoing navigation, effectively behaving like the example shown before. In real world scenarios, adding is more likely to happen outside of navigation guards, e.g. when a view component mounts, it register new routes.
5656

Diff for: packages/docs/zh/guide/advanced/dynamic-routing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ router.beforeEach(to => {
5050
})
5151
```
5252

53-
上面的例子有两个假设:第一,新添加的路由记录将与 `to` 位置相匹配,实际上导致与我们试图访问的位置不同。第二,`hasNecessaryRoute()` 在添加新的路由后返回 `false`,以避免无限重定向。
53+
上面的例子有两个假设:第一,新添加的路由记录将与 `to` 位置相匹配,实际上导致与我们试图访问的位置不同。第二,`hasNecessaryRoute()` 在添加新的路由后返回 `true`,以避免无限重定向。
5454

5555
因为是在重定向中,所以我们是在替换将要跳转的导航,实际上行为就像之前的例子一样。而在实际场景中,添加路由的行为更有可能发生在导航守卫之外,例如,当一个视图组件挂载时,它会注册新的路由。
5656

0 commit comments

Comments
 (0)