Not quite sure if this is a post for stackoverflow but i really struggle with this one.
I'm using vuex and vue1. I love vuex because you can't/shouldn't change the store without mutations.
But now I'm passing a state object to a (child) component. When I'm changing the value in the child component. Vuex allows me to change it.
Is there a specific reason why this can be done or is this just bad practice?
Parent component
<child-component :pass-value="stateValueParent"> </child-component>
vuex: {
getters: {
stateValueParent: (state) => state.values.stateValueParent
}
}
Child component
export default {
props: [
'passValue'
],
let value = this.passValue
// This is changed but it should right?
value = 'newValue'