mirror of https://github.com/ElemeFE/element
* DatePicker: Fix Typing a date and tabbing does not close the calendar #4948 * DatePicker: Fix Typing a date and tabbing does not close the calendar #4948 -Updated test case * Fixes #4931pull/5899/merge
parent
c73eeed291
commit
be6cc78004
|
@ -406,11 +406,11 @@
|
|||
|
||||
visibleDate: {
|
||||
get() {
|
||||
return formatDate(this.date);
|
||||
return formatDate(this.date, this.dateFormat);
|
||||
},
|
||||
|
||||
set(val) {
|
||||
const date = parseDate(val, 'yyyy-MM-dd');
|
||||
const date = parseDate(val, this.dateFormat);
|
||||
if (!date) {
|
||||
return;
|
||||
}
|
||||
|
@ -445,6 +445,14 @@
|
|||
} else {
|
||||
return 'HH:mm:ss';
|
||||
}
|
||||
},
|
||||
|
||||
dateFormat() {
|
||||
if (this.format) {
|
||||
return this.format.replace('HH:mm', '').replace(':ss', '').trim();
|
||||
} else {
|
||||
return 'yyyy-MM-dd';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue