fix(Calendar): incorrect height when using rem (#7190)
* fix(Calendar): incorrect height when using rem * fix: realRowHeight default value
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user