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.
- [Vuejs]-Vue router have not seen store state
- [Vuejs]-After click VUE method receives propert only of last element
Source:stackexchange.com