Skip to content
Advertisement

VUETIFY problem when using dialog inside for loop lost index

I have to call a function when within the dialog I press the confirm button with the index where the dialog has started. It always sends me the last index of the for loop and not the one that corresponds

I copy the part of the code to which I refer:

JavaScript

On line 57:

JavaScript

s.key must contain the index from where the dialog was launched, but it contains the last index of the for loop.

I have tried a thousand things and read stackoverflow from top to bottom and I can’t find it, I’m learning VUE on my own

Advertisement

Answer

I was finally able to figure it out. Take the dialog out of the for loop, I have created a variable that tells me which element is the last selected, to which I give value from the button of each element.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement