Closed yuejt14 closed 9 months ago
So i found that Vue has an update that a component cannot emit after being unmounted, is there a way to maybe hide the modal without unmount the modal?
@yuejt14
You have to use new Promise
to wrap the second modal, when the second modal closed or emit a event, resolve the promise. In the first dynamic modal, you can put you logic after await
or inside .then(() => {})
Version
vue-final-modal: v3.4.11 vue: v3.2.45
OS
Mac
Steps to reproduce
I am trying to use use $vfm.show to open one modal, and inside that modal it opens another one. After confirmation, the last modal should emit an event to the first modal , and the second modal should emit the signal back to the parent component. The codes looks like this:
parent.vue
one.vue
two.vue
What is Expected?
So everything works fine, except that when modal one received the event emitted from modal two, it doesn't seem to send the confirm back to parent, the onConfirm in parent.vue never get called. If i removes the "close()" in modal one, then the parent.vue will receive the confirm from modal, but then modal one will remains open when modal two is opened.