diff --git a/src/components/carousel/carousel.vue b/src/components/carousel/carousel.vue index 6bfd7fd6..67f0b246 100644 --- a/src/components/carousel/carousel.vue +++ b/src/components/carousel/carousel.vue @@ -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 diff --git a/src/utils/assist.js b/src/utils/assist.js index c39da765..b62f3ef2 100644 --- a/src/utils/assist.js +++ b/src/utils/assist.js @@ -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; } }, []); }