[Vuejs]-How to generate an array in Vue and then use v-model on an item within the object?

0👍

It’s actually not an issue of method(), method() shall behave the same as data() in this scenario.

The real issue is with the javascript method -> .fill() as it creates a reference pointer to all the items in the array. This may be a good read – JS pass by ref vs pass by val

I tried a workaround, avoided using .fill(), instead filled the array by a simple loop in method(). Attaching a jsfiddle link with a working example for the same.

Leave a comment