I'm new to VueJS, I've got warning from Vue,
[Vue warn]: You may have an infinite update loop in a component render function.
When i use V-for variable in V-bind:style, here is an example : in template :
<div v-for="item in model.items" v-bind:class="test(item.result)">
{{item.id}}
</div>
in script :
data() {
return {
accept: false,
not_accept: false,
};
},
methods: {
test(result) {
if (result == 'accept') {
this.accept = true;
this.not_accept = false;
} else if (result == 'Not accept') {
this.accept = false;
this.not_accept = true;
} else {
console.log(result);
}
return {
success: this.accept,
danger: this.not_accept,
};
},
},