[Vuejs]-How can i call modal component inside a v-for loop?

0👍

Apologies as I am on my mobile. Have you considered having the modal in your parent component outside of the loop?

You could have a data variable to handle your modal e.g

modal: {
    open: false,
    schedule: null }

Essentially then when your button is clicked you could add a v-click with a function that controls this data which in turns handles the content in the modal.

Then on your date picker or modal have a function to handle the update/close to clear this data and handle whatever you need too outside.

Then you could combine this into one component.

I see you have vuex you could also use vuex to control your modal and it’s contents.

Leave a comment