fix: datepicker header error #2488
parent
71bf529688
commit
535fb55ac9
|
@ -174,7 +174,7 @@ const CalendarHeader = {
|
||||||
panel = (
|
panel = (
|
||||||
<YearPanel
|
<YearPanel
|
||||||
locale={locale}
|
locale={locale}
|
||||||
defaultValue={value}
|
value={value}
|
||||||
rootPrefixCls={prefixCls}
|
rootPrefixCls={prefixCls}
|
||||||
onSelect={this.onYearSelect}
|
onSelect={this.onYearSelect}
|
||||||
onDecadePanelShow={this.showDecadePanel}
|
onDecadePanelShow={this.showDecadePanel}
|
||||||
|
@ -186,7 +186,7 @@ const CalendarHeader = {
|
||||||
panel = (
|
panel = (
|
||||||
<DecadePanel
|
<DecadePanel
|
||||||
locale={locale}
|
locale={locale}
|
||||||
defaultValue={value}
|
value={value}
|
||||||
rootPrefixCls={prefixCls}
|
rootPrefixCls={prefixCls}
|
||||||
onSelect={this.onDecadeSelect}
|
onSelect={this.onDecadeSelect}
|
||||||
renderFooter={renderFooter}
|
renderFooter={renderFooter}
|
||||||
|
|
|
@ -35,7 +35,11 @@ export default {
|
||||||
sValue: this.value || this.defaultValue,
|
sValue: this.value || this.defaultValue,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
value(val) {
|
||||||
|
this.sValue = val;
|
||||||
|
},
|
||||||
|
},
|
||||||
render() {
|
render() {
|
||||||
const value = this.sValue;
|
const value = this.sValue;
|
||||||
const { locale, renderFooter } = this.$props;
|
const { locale, renderFooter } = this.$props;
|
||||||
|
|
|
@ -36,6 +36,11 @@ export default {
|
||||||
sValue: this.value || this.defaultValue,
|
sValue: this.value || this.defaultValue,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
value(val) {
|
||||||
|
this.sValue = val;
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
years() {
|
years() {
|
||||||
const value = this.sValue;
|
const value = this.sValue;
|
||||||
|
|
Loading…
Reference in New Issue