I'm new to Vuejs. Made something, but I don't know it's the simple / right way.
what I want
I want some dates in an array and update them on a event. First I tried Vue.set, but it dind't work out. Now after changing my array item:
this.items[index] = val;
this.items.push();
I push() nothing to the array and it will update.. But sometimes the last item will be hidden, somehow... I think this solution is a bit hacky, how can I make it stable?
Simple code is here:
Vue.set(object, prop, value)
For vuex you will want to do Vue.set(state.object, key, value)
So just for others who come to this question. It appears at some point in Vue 2.* they removed this.items.$set(index, val)
in favor of this.$set(this.items, index, val)
.
Splice is still available and here is a link to array mutation methods available in vue link.