fix(Calendar): should not render all months on mounted (#7564)

This commit is contained in:
neverland
2020-11-15 17:26:46 +08:00
committed by GitHub
parent 5b4e063fa9
commit 0bd1128b91
4 changed files with 67 additions and 96 deletions
-7
View File
@@ -112,7 +112,6 @@ export default createComponent({
return {
subtitle: '',
currentDate: this.getInitialDate(),
realRowHeight: 0,
};
},
@@ -404,10 +403,6 @@ export default createComponent({
this.$emit('confirm', copyDates(this.currentDate));
},
onUpdateHeight(height) {
this.realRowHeight = height;
},
genMonth(date, index) {
const showMonthTitle = index !== 0 || !this.showSubtitle;
return (
@@ -426,11 +421,9 @@ export default createComponent({
currentDate={this.currentDate}
showSubtitle={this.showSubtitle}
allowSameDay={this.allowSameDay}
realRowHeight={this.realRowHeight}
showMonthTitle={showMonthTitle}
firstDayOfWeek={this.dayOffset}
onClick={this.onClickDay}
onUpdate-height={this.onUpdateHeight}
/>
);
},