Skip to content

refactor(addRoute): create route only when parent.alias exists #3569

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

Merged
merged 2 commits into from
Jun 16, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
refactor(addRoute): create route only when parent.alias is not an emp…
…ty array


if parent.alias is an empty array, there is no need to execute createRouteMap

Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
  • Loading branch information
alphawq and posva authored Jun 16, 2021
commit be51ea191ce70c8f5b4418b5c37335048ff090ed
2 changes: 1 addition & 1 deletion src/create-matcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function createMatcher (
createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent)

// add aliases of parent
if (parent && parent.alias) {
if (parent && parent.alias.length) {
createRouteMap(
// $flow-disable-line route is defined if parent is
parent.alias.map(alias => ({ path: alias, children: [route] })),
Expand Down