Vue-js-modal: Question: How can I hide modal, if I do not know their "name"?

Created on 27 Apr 2018  ยท  10Comments  ยท  Source: euvl/vue-js-modal

Problem:

Hi. I have some logic in my application, and I have a lot of modals in different components. I need to hide current opened modal, but I can not know which one will be opened, and I can not know their name.

Question: Can I hide the modal without knowing their name?

P.S. I remember that I can save the name of the current modal when it opens (using the beforeOpen method), but it will not be very convenient, since I have a large number of modals.

question

Most helpful comment

oh this was easy. Just emit a close event with a button or something in your Modal:
@click="$emit('close')"

All 10 comments

In older incarnation, if you call hide/close without name it would close everything, i will take a look if this is still the case

Yeah this is kind of frustrating when using dynamic modals, as far as I can tell there's no way to explicitly tell a modal to close itself.

@Nfinished You can look into the code and implement this feature, no need to stay frustrated ๐Ÿ˜„ ๐Ÿ‘

@euvl If I have enough time and experience - I can add this functionality. I will try to do it in the near future.

oh this was easy. Just emit a close event with a button or something in your Modal:
@click="$emit('close')"

Wait a minute, it is docs isnt it?
screen shot 2018-05-17 at 14 20 17

@sergei97k @Nfinished @christophwolff ^

@euvl sorry! Great plugin! thanks for the good work! keep it on! ๐Ÿ’ฏ

Cripes, we're blind

On Thu, May 17, 2018, 9:22 AM Christoph Wolff notifications@github.com
wrote:

@euvl https://github.com/euvl sorry! Great plugin! thanks for the good
work! keep it on! ๐Ÿ’ฏ

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/euvl/vue-js-modal/issues/222#issuecomment-389864137,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABo970-iouLL9db6oYUf7BcptmwzxW3rks5tzXmKgaJpZM4TqYiW
.

No probs, thanks ๐Ÿ‘ I will prob. make it more visible in the docs. Clearly it is confusing and/or not evident

In older incarnation, if you call hide/close without name it would close everything, i will take a look if this is still the case

I tried and this is not the case as of v1.3.26

This PR should solve the problem though: https://github.com/euvl/vue-js-modal/pull/347

Was this page helpful?
0 / 5 - 0 ratings

Related issues

a3020 picture a3020  ยท  5Comments

dland512 picture dland512  ยท  4Comments

MacgyverMartins picture MacgyverMartins  ยท  4Comments

ar53n picture ar53n  ยท  4Comments

uptownhr picture uptownhr  ยท  4Comments