Open Accide opened 4 years ago
在calendar.js中,找到方法getRightArr,改一下_length这一行即可
getRightArr(date) {
const arr = [];
const nextDate = this.getOtherMonth(date, 'nextMonth');
const leftLength = this.getDaysInOneMonth(date) + this.getMonthweek(date);
const _length = leftLength < 35 ? 14 - leftLength % 7 : 7 - leftLength % 7;
for (let i = 0; i < _length; i++) {
const nowTime = nextDate.getFullYear() + '/' + (nextDate.getMonth() + 1) + '/' + (i + 1);
arr.push({
id: i + 1,
date: nowTime,
isToday: false,
otherMonth: 'nextMonth',
});
}
return arr;
},
每月应该是显示42个数据,现在的代码有可能会显示35条,各位需要使用的注意点