1👍
Had a slight moment forgetting novice JavaScript principles
replacing:
vm.$set(vm.fixtures, m, element);
to:
vm.fixtures[m] = element;
did the trick.
- [Vuejs]-Prevent opening the image in browser when drop image file in Vue
- [Vuejs]-VueJS, Vuetify, data-table – expandable, performance problem
0👍
To follow up on your own answer you can improve your code a little bit by doing the following:
setFixtureMonths: function (collection) {
collection.forEach((element) => {
let d = new Date(element.date);
let m = d
.toLocaleString('default', {
month: 'long'
})
.toLocaleLowerCase();
this.$set(vm.fixtures, m, element);
});
}
by replacing the anonymous function by an arrow function you will have access to the parent context, therefore no need to have let vm = this;
Source:stackexchange.com