Closed guillaumeduhan closed 5 years ago
Can You please prepare Codesandbox.io example? It works be much easier to debug the issue. Regards.
Hello @karol-f and thanks for your answer,
This is the sandbox I've created: https://codesandbox.io/s/vue-template-958nh
hello-world component emit 'myEvent'. I want to know if any future parent can receive myEvent.
I already tried to catch an event from a VCE in a parent but it didn't work with: "this.$on...."
Thanks for help ;)
Hi, I've checked Your sandbox and I can see 2 problems:
App.vue
. I've just added @myEvent="onMyEvent"
and it's working.https://codesandbox.io/s/vue-template-gi8b3
If You will have more questions feel free to ask them. Regards!
Thank you very much @karol-f it's working.
Regards
Hello guys,
I've been searching and testing but I didn't find any solution. I'll try to explain it very clearly:
This is my situation: with Vue Custom Element, I import my component A from John to Sam.
A is my child component coming from John.
Sam is my parent where A goes.
I tried to emit an event from A to Sam but it didn't work.
Question: can I emit an event from A to Sam? is it possible?
Documentation: listening to Vue component $emit'ed events.
Thanks for your answers.
Guillaume