Merge pull request #6327 from demi798/2.0

fix bug #6326
This commit is contained in:
debugIsFalse 2019-10-29 11:10:46 +08:00 committed by GitHub
commit d241b8fe7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -214,7 +214,7 @@ export function findComponentDownward (context, componentName) {
// Find components downward
export function findComponentsDownward (context, componentName, ignoreComponentNames = []) {
if (!Array.isArray(ignoreComponentNames)) {
ignoreComponentNames = [ignoreComponentNames]
ignoreComponentNames = [ignoreComponentNames];
}
return context.$children.reduce((components, child) => {
if (child.$options.name === componentName) components.push(child);
@ -222,7 +222,7 @@ export function findComponentsDownward (context, componentName, ignoreComponentN
const foundChilds = findComponentsDownward(child, componentName);
return components.concat(foundChilds);
} else {
return components
return components;
}
}, []);
}