mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 09:20:51 +08:00
fix: fix date picker second clear not trigger change event (#1438)
fix #1359
This commit is contained in:
parent
82482a2076
commit
7170bdeacc
@ -207,9 +207,9 @@ export default defineComponent({
|
|||||||
valueOnOpen.value = props.modelValue
|
valueOnOpen.value = props.modelValue
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const emitChange = val => {
|
const emitChange = (val, isClear) => {
|
||||||
// determine user real change only
|
// determine user real change only
|
||||||
if (!valueEquals(val, valueOnOpen.value)) {
|
if (isClear || !valueEquals(val, valueOnOpen.value)) {
|
||||||
ctx.emit('change', val)
|
ctx.emit('change', val)
|
||||||
props.validateEvent && elFormItem.formItemMitt?.emit('el.form.change', val)
|
props.validateEvent && elFormItem.formItemMitt?.emit('el.form.change', val)
|
||||||
}
|
}
|
||||||
@ -322,7 +322,7 @@ export default defineComponent({
|
|||||||
if (showClose.value) {
|
if (showClose.value) {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
emitInput(null)
|
emitInput(null)
|
||||||
emitChange(null)
|
emitChange(null, true)
|
||||||
showClose.value = false
|
showClose.value = false
|
||||||
pickerVisible.value = false
|
pickerVisible.value = false
|
||||||
pickerOptions.value.handleClear && pickerOptions.value.handleClear()
|
pickerOptions.value.handleClear && pickerOptions.value.handleClear()
|
||||||
|
Loading…
Reference in New Issue
Block a user