fix: datepicker header error #2488

pull/1775/head
tanjinzhou 2020-07-03 15:19:19 +08:00
parent 71bf529688
commit 535fb55ac9
3 changed files with 12 additions and 3 deletions

View File

@ -174,7 +174,7 @@ const CalendarHeader = {
panel = (
<YearPanel
locale={locale}
defaultValue={value}
value={value}
rootPrefixCls={prefixCls}
onSelect={this.onYearSelect}
onDecadePanelShow={this.showDecadePanel}
@ -186,7 +186,7 @@ const CalendarHeader = {
panel = (
<DecadePanel
locale={locale}
defaultValue={value}
value={value}
rootPrefixCls={prefixCls}
onSelect={this.onDecadeSelect}
renderFooter={renderFooter}

View File

@ -35,7 +35,11 @@ export default {
sValue: this.value || this.defaultValue,
};
},
watch: {
value(val) {
this.sValue = val;
},
},
render() {
const value = this.sValue;
const { locale, renderFooter } = this.$props;

View File

@ -36,6 +36,11 @@ export default {
sValue: this.value || this.defaultValue,
};
},
watch: {
value(val) {
this.sValue = val;
},
},
methods: {
years() {
const value = this.sValue;