Skip to content

Commit 52ab5a0

Browse files
committed
docs: add redirect
1 parent e087ea4 commit 52ab5a0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/en/api/redirect.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ router.redirect({
1818

1919
// redirect can contain dynamic segments
2020
// the dynamic segment names must match
21-
'/user/:userId': '/profile/:userId'
21+
'/user/:userId': '/profile/:userId',
22+
23+
// redirect any not-found route to home
24+
'*': '/home'
2225
})
2326
```

docs/zh-cn/api/redirect.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ router.redirect({
1818

1919
// 重定向可以包含动态片段
2020
// 而且重定向片段必须匹配
21-
'/user/:userId': '/profile/:userId'
21+
'/user/:userId': '/profile/:userId',
22+
23+
// 重定向任意未匹配路径到 /home
24+
'*': '/home'
2225
})
2326
```

0 commit comments

Comments
 (0)