This commit is contained in:
xinxin.li 2019-10-08 19:45:17 +08:00
parent 03d8b80d45
commit e3801e6d70
2 changed files with 3 additions and 3 deletions

View file

@ -201,7 +201,7 @@
child.width = this.listWidth;
child.height = typeof this.height === 'number' ? `${this.height}px` : this.height;
});
const slidesLength = this.slides.length || 0
const slidesLength = this.slides.length || 0;
this.trackWidth = slidesLength * this.listWidth;
},
// use when slot changed

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;
}
}, []);
}