[Vuejs]-Vue error: infinite update loop in a component render function

0👍

The contacts method is being called during the render, which has this.result.splice() that modifies this.result, which Vue will detect and schedule a re-render of the component. Mutating reactive component state during a render is the cause of this warning.

Since you’re not actually using i, instead of

<tr v-for="i in [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]">

you can do

<tr v-for="i in 17">

I’m not exactly sure what you’re trying to achieve. It looks like you want to render a table with 17 rows, each row containing consecutive integers starting at a random integer between 1-16 and the numbers wrap around?

Leave a comment