Skip to content

补充h5.router.customRoutes重定向和转发的用法文档 #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/config-detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,12 @@ module.exports = {
router: {
customRoutes: {
// "页面路径": "自定义路由"
// 相当于转发,Taro.navigateTo({url: '/index'}),落地页的url为'/index',页面内容为'/pages/index/index'
'/pages/index/index': '/index',
'/pages/detail/index': ['/detail'], // 可以通过数组为页面配置多个自定义路由
// "自定义路由": "页面路径"
// 相当于重定向,Taro.navigateTo({url: '/index'}),落地页的url为'/pages/index/index',页面内容为'/pages/index/index'
'/index': '/pages/index/index',
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions versioned_docs/version-3.x/config-detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -1481,8 +1481,12 @@ module.exports = {
router: {
customRoutes: {
// "页面路径": "自定义路由"
// 相当于转发,Taro.navigateTo({url: '/index'}),落地页的url为'/index',页面内容为'/pages/index/index'
'/pages/index/index': '/index',
'/pages/detail/index': ['/detail'], // 可以通过数组为页面配置多个自定义路由
// "自定义路由": "页面路径"
// 相当于重定向,Taro.navigateTo({url: '/index'}),落地页的url为'/pages/index/index',页面内容为'/pages/index/index'
'/index': '/pages/index/index',
},
},
},
Expand Down
Loading