-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat(router): 约定式路由 pages/xx/index/index.js 与 pages/index/index.js 保持一致 #2466
Conversation
Pull Request Test Coverage Report for Build 3740
💛 - Coveralls |
newPath = newPath.replace(/\/index$/, '/'); | ||
newPath = newPath.replace(/\/index/g, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉有点怪,是不是应该只替换最后一个 index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2346 这个issues的需求是生成这样的路由 :
{
"path": "/user",
"component": dynamic({ loader: () => import('../user/index/index.js') })
}
只替换最后一个 index的话,路由会这样生成
{
"path": "/user/index",
"component": dynamic({ loader: () => import('../user/index/index.js') })
}
.gitignore
Outdated
@@ -21,3 +21,4 @@ lerna-debug.log | |||
.umi-production | |||
*.sw* | |||
*.un~ | |||
.vscode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要提交这个,放自己的 ~/.gitignore_global 里。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要提交这个,放自己的 ~/.gitignore_global 里。
已更新
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Checklist
npm test
passesDescription of change
约定式路由 pages/xx/index/index.js 与 pages/index/index.js 保持一致