feat: date-picker ok calendar support string value
parent
ff07ecd3e7
commit
0c8951ab5a
|
@ -115,6 +115,16 @@ export default function wrapPicker(Picker, props, pickerType) {
|
||||||
dateString,
|
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() {
|
focus() {
|
||||||
this.$refs.picker.focus();
|
this.$refs.picker.focus();
|
||||||
},
|
},
|
||||||
|
@ -208,6 +218,8 @@ export default function wrapPicker(Picker, props, pickerType) {
|
||||||
mouseenter: this.handleMouseEnter,
|
mouseenter: this.handleMouseEnter,
|
||||||
mouseleave: this.handleMouseLeave,
|
mouseleave: this.handleMouseLeave,
|
||||||
change: this.handleChange,
|
change: this.handleChange,
|
||||||
|
ok: this.handleOk,
|
||||||
|
calendarChange: this.handleCalendarChange,
|
||||||
},
|
},
|
||||||
ref: 'picker',
|
ref: 'picker',
|
||||||
scopedSlots: this.$scopedSlots || {},
|
scopedSlots: this.$scopedSlots || {},
|
||||||
|
|
Loading…
Reference in New Issue