fix: typo

This commit is contained in:
msidolphin 2019-08-23 21:46:45 +08:00 committed by GitHub
parent 67ddfcb7ed
commit 9e694e9661
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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