Enum breaks defineEmit with Type-based declaration
Vue version
Link to minimal reproduction
Steps to reproduce
Run this code. Try with passing BUTTON_EVENTS.CLICK
enum value inside defineEmits and simple string value 'click'
. See console.
What is expected?
The click event handler inside App.vue should run a single time.
What is actually happening?
The click event handler inside App.vue runs twice.
System Info
No response
Any additional comments?
I guess it is something has to do with enums because behavior differs with or without them.
Also, it works the same when we use Runtime declaration of defineEmits like that:
const emit = defineEmits([BUTTON_EVENTS.CLICK])
works the same as
const emit = defineEmits(['click'])