Hi, I have a parent component which has an action-sheet. It also has a child modal component. The action-sheet needs to be launchable from both the parent component and the modal child. Ordinarily in Vue we can emit an event from the child component and consume that in the parent e.g.
Modal (child) component:
export default defineComponent({
name: 'myModal',
components: { ... },
setup(props, { emit }) {
const closeModal = () => {
modalController.dismiss()
}
const launchActionSheetOnParent = () => {
emit('launchActionSheet')
}
return {
closeModal,
launchActionSheetOnParent,
}
},
})
However, in the parent component, the modal is created like this:
const initModal = async () => {
const modal = await modalController.create({
component: myModal,
})
return modal.present()
}
How does the parent listen for the emitted event, in this scenario?