8000 refactor(addRoute): create route only when parent.alias exists (#3569) · vuejs/vue-router@9a0b9fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a0b9fb

Browse files
alphawqwangqiang025posva
authored
refactor(addRoute): create route only when parent.alias exists (#3569)
* fix(addRoute): create routing only when parent.alias exists * refactor(addRoute): create route only when parent.alias is not an empty 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> Co-authored-by: wangqiang025 <wangqiang025@ke.com> Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
1 parent 68ad650 commit 9a0b9fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/create-matcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function createMatcher (
3232
createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent)
3333

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

0 commit comments

Comments
 (0)
0