0👍
✅
After a few days looking at the problem in reactivity, the fix was the following:
Changed this
role_permissions: {}
To this:
role_permissions: []
Then the critical part of why this was not working, was in the initialization of the array. This happens in getPermissions() and this is what I did:
Changed this:
for(var i = 0; i < this.permissions.length; i++){
this.role_permissions[this.permissions[i].name] = this.hasPerm(this.permissions[i].name);
}
To this:
for(var i = 0; i < this.permissions.length; i++){
this.$set(this.role_permissions, this.permissions[i].name, this.hasPerm(this.permissions[i].name));
}
Instead of using "=" use "$set" for value assignment.
Source:stackexchange.com