vue-modal-dialogs icon indicating copy to clipboard operation
vue-modal-dialogs copied to clipboard

Pass event listeners to dialog?

Open arthabus opened this issue 3 years ago • 3 comments

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.

arthabus avatar Sep 16 '20 08:09 arthabus

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.

hjkcai avatar Sep 28 '20 04:09 hjkcai

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.

arthabus avatar Sep 29 '20 09:09 arthabus

Maybe just import the validator directly in the dialog component? That seems easier 😄

hjkcai avatar Oct 03 '20 08:10 hjkcai