feat: date-picker ok calendar support string value

pull/2184/head
tanjinzhou 2020-04-30 16:16:07 +08:00
parent ff07ecd3e7
commit 0c8951ab5a
1 changed files with 12 additions and 0 deletions

View File

@ -115,6 +115,16 @@ export default function wrapPicker(Picker, props, pickerType) {
dateString,
);
},
handleOk(val) {
this.$emit('ok', this.valueFormat ? momentToString(val, this.valueFormat) : val);
},
handleCalendarChange(date, dateString) {
this.$emit(
'calendarChange',
this.valueFormat ? momentToString(date, this.valueFormat) : date,
dateString,
);
},
focus() {
this.$refs.picker.focus();
},
@ -208,6 +218,8 @@ export default function wrapPicker(Picker, props, pickerType) {
mouseenter: this.handleMouseEnter,
mouseleave: this.handleMouseLeave,
change: this.handleChange,
ok: this.handleOk,
calendarChange: this.handleCalendarChange,
},
ref: 'picker',
scopedSlots: this.$scopedSlots || {},