Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

hfuuss
Copy link
Contributor

@hfuuss hfuuss commented May 23, 2019

Checklist
  • npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change

约定式路由 pages/xx/index/index.js 与 pages/index/index.js 保持一致

@coveralls
Copy link

coveralls commented May 23, 2019

Pull Request Test Coverage Report for Build 3740

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 30 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.3%) to 36.292%

Files with Coverage Reduction New Missed Lines %
packages/umi-build-dev/src/plugins/commands/block/index.js 30 49.61%
Totals Coverage Status
Change from base Build 3701: 0.3%
Covered Lines: 1435
Relevant Lines: 3964

💛 - Coveralls

newPath = newPath.replace(/\/index$/, '/');
newPath = newPath.replace(/\/index/g, '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉有点怪,是不是应该只替换最后一个 index?

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要提交这个,放自己的 ~/.gitignore_global 里。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要提交这个,放自己的 ~/.gitignore_global 里。

已更新

@stale
Copy link

stale bot commented Aug 25, 2019

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.

@stale stale bot added the wontfix label Aug 25, 2019
@stale stale bot closed this Sep 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] 约定式路由 pages/xx/index/index.js 与 pages/index/index.js 保持一致
3 participants