I am dynamically creating a Vue component and need to listen to the event it emits. While I know that you can use @eventName
in the markup, my component is being created using createApp
.
const div = document.createElement('div');
this.$refs.login.appendChild(div);
let props = {
/** some props **/
};
createApp(Component, props).mount(div);
This is how I generate the Component
. The answer provided here addresses the issue but it pertains to Vue2, where the $on
method has been removed in Vue3.
How can I achieve this in Vue3?