fix(Calendar): incorrect height when using rem (#7190)

* fix(Calendar): incorrect height when using rem

* fix: realRowHeight default value
This commit is contained in:
neverland
2020-09-16 21:07:11 +08:00
committed by GitHub
parent 2e6e5a934b
commit 35f7e818e2
5 changed files with 41 additions and 21 deletions
+8 -5
View File
@@ -8,7 +8,6 @@ import {
copyDates,
getNextDay,
compareDay,
ROW_HEIGHT,
calcDateNum,
compareMonth,
createComponent,
@@ -29,6 +28,7 @@ export default createComponent({
value: Boolean,
readonly: Boolean,
formatter: Function,
rowHeight: [Number, String],
confirmText: String,
rangePrompt: String,
defaultDate: [Date, Array],
@@ -51,10 +51,6 @@ export default createComponent({
type: Boolean,
default: true,
},
rowHeight: {
type: [Number, String],
default: ROW_HEIGHT,
},
maxRange: {
type: [Number, String],
default: null,
@@ -115,6 +111,7 @@ export default createComponent({
return {
subtitle: '',
currentDate: this.getInitialDate(),
realRowHeight: 0,
};
},
@@ -403,6 +400,10 @@ export default createComponent({
this.$emit('confirm', copyDates(this.currentDate));
},
onUpdateHeight(height) {
this.realRowHeight = height;
},
genMonth(date, index) {
const showMonthTitle = index !== 0 || !this.showSubtitle;
return (
@@ -421,9 +422,11 @@ 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}
/>
);
},