With dynamic module, how to return data (e.g. user input) back to caller component (where this.$modal.show(...) called)?
through vuex or observers or global event bus
I chose to use event bus for this in my app, but it's interesting did you consider API with returning promise from $modal.show() method? Usually we need data from modal in place where we called it, and it would be very familiar for developers coming from angularjs.
not really, i feel like its up for developer how to implement it (as it is doable task) and has nothing to do with showing modal (which this library is build for).
When I first started using it, going from the examples I was under the impression I was able to set handlers for events emitted from inside the modal in the 4th parameter of $modal.show(), like it does for before-close and so on. That seems more intuitive and versatile for me if it was an option, than going through an event bus or vuex.
For example inside the modal $emit('modal-event', payload), and showing the modal like this:
this.$modal.show(
ModalComponent,
{},
{ height: 'auto' },
{
'modal-event': payload => {
console.log(payload);
},
},
);
Most helpful comment
When I first started using it, going from the examples I was under the impression I was able to set handlers for events emitted from inside the modal in the 4th parameter of $modal.show(), like it does for before-close and so on. That seems more intuitive and versatile for me if it was an option, than going through an event bus or vuex.
For example inside the modal $emit('modal-event', payload), and showing the modal like this: