he2802 3 years ago
parent
commit
e415ea8bd5
1 changed files with 5 additions and 1 deletions
  1. 5 1
      pages2/plan/index.vue

+ 5 - 1
pages2/plan/index.vue

@@ -272,8 +272,12 @@ export default {
 			this.calendarStudyVo.miniDayStudyList = []; //创建缩放的数组
 			let date = new Date();
 			let num = date.getDate();
-			
+			//如果不是当前月,默认显示第一周
+			if ((date.getMonth() + 1) != this.calendarStudyVo.month) {
+				num = 1;
+			}
 			 for (let i = 0; i < firstItem.studyDay; i++) {
+				 //补齐1号前的日数凑满一周
 				this.calendarStudyVo.dayStudyList.unshift({ date: 0 });
 			} 
 			let todayIndex;