Skip to content

Commit 535fb55

Browse files
committed
fix: datepicker header error #2488
1 parent 71bf529 commit 535fb55

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const CalendarHeader = {
174174
panel = (
175175
<YearPanel
176176
locale={locale}
177-
defaultValue={value}
177+
value={value}
178178
rootPrefixCls={prefixCls}
179179
onSelect={this.onYearSelect}
180180
onDecadePanelShow={this.showDecadePanel}
@@ -186,7 +186,7 @@ const CalendarHeader = {
186186
panel = (
187187
<DecadePanel
188188
locale={locale}
189-
defaultValue={value}
189+
value={value}
190190
rootPrefixCls={prefixCls}
191191
onSelect={this.onDecadeSelect}
192192
renderFooter={renderFooter}

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ export default {
3535
sValue: this.value || this.defaultValue,
3636
};
3737
},
38-
38+
watch: {
39+
value(val) {
40+
this.sValue = val;
41+
},
42+
},
3943
render() {
4044
const value = this.sValue;
4145
const { locale, renderFooter } = this.$props;

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

+5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export default {
3636
sValue: this.value || this.defaultValue,
3737
};
3838
},
39+
watch: {
40+
value(val) {
41+
this.sValue = val;
42+
},
43+
},
3944
methods: {
4045
years() {
4146
const value = this.sValue;

0 commit comments

Comments
 (0)