Browse Source

fix: datepicker header error #2488

pull/1775/head
tanjinzhou 4 years ago
parent
commit
535fb55ac9
  1. 4
      components/vc-calendar/src/calendar/CalendarHeader.jsx
  2. 6
      components/vc-calendar/src/decade/DecadePanel.jsx
  3. 5
      components/vc-calendar/src/year/YearPanel.jsx

4
components/vc-calendar/src/calendar/CalendarHeader.jsx

@ -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}

6
components/vc-calendar/src/decade/DecadePanel.jsx

@ -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;

5
components/vc-calendar/src/year/YearPanel.jsx

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

Loading…
Cancel
Save