[Vuejs]-Pushing to array leads to infinite loop

2๐Ÿ‘

โœ…

What i got: an endless loop where after the last day, it just repeats itself ad infinitum.

Whenever you call formatDays it causes a re-render as the data being displayed in the template is being changed. Since formatDays is a method and used directly in the template using {{}} it is called on every re-render. Hence the infinite loop.

What I expected: My second array should be filled with a copy of the days.

I have updated your fiddle.

๐Ÿ‘คVamsi Krishna

Leave a comment