I am creating a Vue component dynamically and I want to listen to an event that it emits. I know you can use the @eventName in the markup but I am creating the component 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 create the Component. This answer here works for my problem but it for Vue2 and the $on has been removed in Vue3.
How can I achieve this using Vue3?