Dynamic v-on and static v-on should be merged (first is overriden)
Vue version
3.2.39
Link to minimal reproduction
Steps to reproduce
Add a static v-on followed by a dynamic v-on:
<script setup>
defineProps(['validateEvent'])
</script>
<template>
<input
@blur="onBlur"
@[validateEvent]="onValidate"
>
</template>
What is expected?
onBlur
is called even if validateEvent === 'blur'
What is actually happening?
onBlur
is not called
System Info
No response
Any additional comments?
No response
The compiler should probably generate
_withDirectives(_createElementVNode("input", _mergeProps(attrs, {
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((msg).value = $event)),
onBlur: onBlur,
}, {
[_toHandlerKey(validateEvent)]: onValidateEvent
}, _toHandlers(listeners, true)), null, 16 /* FULL_PROPS */), [
[_vModelDynamic, msg.value]
])
instead of:
_withDirectives(_createElementVNode("input", _mergeProps(attrs, {
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((msg).value = $event)),
onBlur: onBlur,
[_toHandlerKey(validateEvent)]: onValidateEvent
}, _toHandlers(listeners, true)), null, 16 /* FULL_PROPS */), [
[_vModelDynamic, msg.value]
])