While I have been able to successfully pass down the state object as a prop and change arrays to overwrite the whole object on property change, I'm facing difficulties when it comes to changing property literals.
The documentation implies that I should be able to modify arrays/objects, but for some reason I can't simply do something like object.prop = "string". It's puzzling why I can update arrays in the state object which is supposed to be immutable. There are some workarounds for modifying literal props, but they often lead to inconsistencies with the original prop. I am open to exploring more efficient solutions for creating forms to alter state object properties.
<div id="skillListing" class="ui item" @change="resetSkill">
<input :value="filter.name" placeholder="edit me">
props: [
"filter",
"fIndex",
"gIndex"
],
methods: {
resetSkill () {
console.log(this.filter.name) // this won't change
this.$store.commit('upsert_skill', {o: this.filter, f: this.fIndex, g: this.gIndex})
}
}