vendredi 1 avril 2016

Select all checkbox with Vue.js (issues with for looping inside a .vue file)

I am looking for how to do a "Select All" checkbox with Vue.js and actually a I kind of found a solution here.

The problem is I am using Vueify and doing everything on my .vue file so some syntax is different then on the example and I can't fix it!

My problem is on this part of the FiddleJS

for (user in this.users) {
    this.userIds.push(this.users[user].id);
}

This for is not recognized on my code I don't know why! If I insert a console.log(user) inside the for it returns:

Uncaught ReferenceError: user is not defined

Somebody knows what is happening?




Aucun commentaire:

Enregistrer un commentaire