<button (click)=“prevMonth()”>上一月
<button (click)=“nextMonth()”>下一月
prevMonth() {
this.currentMonth.setMonth(this.currentMonth.getMonth() - 1);
this.days = […Array(this.currentMonth.getDate()).keys()].map((x) => x + 1);
}
nextMonth() {
this.currentMonth.setMonth(this.currentMonth.getMonth() + 1);
this.days = […Array(this.currentMonth.getDate()).keys()].map((x) => x + 1);
}
}