vue-modal-dialogs
vue-modal-dialogs copied to clipboard
Pass event listeners to dialog?
Hi, is there a way to pass event listeners to dialog component?
I'm using create
and I know I can pass a function to prop as a workaround but for consistency with my other code I'm looking for a way to pass event listeners so they are attached to the dialog's $listeners
Would appreciate any input on that.
There is currently no way to pass listeners to the dialog component. Your workaround is the only way.
However, thick twice that why do you need another "callback" when you prompt the user? vue-modal-dialogs is designed for ask&answer model.
Thanks, got you. I need this for different sorts of async validations - the dialog must be closed only after the validation was successful and the validation can't be a part of the dialog's implementation for it to be reusable.
Maybe just import the validator directly in the dialog component? That seems easier 😄