Merge pull request from demi798/2.0

fix bug 
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
src
components
carousel
date-picker/base
utils

View file

@ -201,7 +201,7 @@
child.width = this.listWidth; child.width = this.listWidth;
child.height = typeof this.height === 'number' ? `${this.height}px` : this.height; 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; this.trackWidth = slidesLength * this.listWidth;
}, },
// use when slot changed // use when slot changed

View file

@ -75,7 +75,8 @@
return this.calendar(tableYear, tableMonth, (cell) => { return this.calendar(tableYear, tableMonth, (cell) => {
// normalize date offset from the dates provided by jsCalendar // normalize date offset from the dates provided by jsCalendar
if (cell.date instanceof Date) cell.date.setTime(cell.date.getTime() + cell.date.getTimezoneOffset() * 60000); // Comment out this code to fix daylight saving time bug
// if (cell.date instanceof Date) cell.date.setTime(cell.date.getTime() + cell.date.getTimezoneOffset() * 60000);
const time = cell.date && clearHours(cell.date); const time = cell.date && clearHours(cell.date);
const dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth(); const dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth();

View file

@ -214,7 +214,7 @@ export function findComponentDownward (context, componentName) {
// Find components downward // Find components downward
export function findComponentsDownward (context, componentName, ignoreComponentNames = []) { export function findComponentsDownward (context, componentName, ignoreComponentNames = []) {
if (!Array.isArray(ignoreComponentNames)) { if (!Array.isArray(ignoreComponentNames)) {
ignoreComponentNames = [ignoreComponentNames] 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);
@ -222,7 +222,7 @@ export function findComponentsDownward (context, componentName, ignoreComponentN
const foundChilds = findComponentsDownward(child, componentName); const foundChilds = findComponentsDownward(child, componentName);
return components.concat(foundChilds); return components.concat(foundChilds);
} else { } else {
return components return components;
} }
}, []); }, []);
} }