vue3 + Web component doesn't emit basic custom event
Version
3.2.29
Reproduction link
Steps to reproduce
- npm i && npm run build
- go to examples folder
- go to vue2 or vue3 project
- npm i && npm run serve
- check that the click button doesnt send the event as it should
What is expected?
The event should be send.
What is actually happening?
doing nothing
I used defineEmits as define in the doc https://v3.vuejs.org/guide/web-components.html#definecustomelement nothing is working.
defineEmits works for for me when I do this:
const emit = defineEmits(['customme'])
const handleClick = () => {
emit('customme', {
test: 'information'
})
}
Definitely working thank you ! What would be the best practice with a vue2 project . Ref to https://github.com/vuejs/core/issues/5313
Yes, I think so. React uses its own synthetic event system which, as far as I understand, doesn't work seamlessly with CustomEvents