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 us
@Decade is right about the problem. Here is the exact problem:
NOTE: render method is triggered whenever any state changes
test
this function is flawed as it is again trying to mutate the state, thus causing the render - test - render cycle.You can solve this problem by making your test function not mutate the state instead, like so:
methods: {
test(result) {
let accept;
if (result == 'accept') {
accept = true;
} else if (result == 'Not accept') {
accept = false;
} else {
console.log(result);
}
return {
success: accept,
danger: !accept,
};
},
}
I hope that helped!