You are attached to the computed property. To set a value for a computed property, you need to write getand methods set.
computed:{
test:{
get(){ return this.$store.getters.test; },
set( value ){ this.$store.commit("TEST_COMMIT", value );}
}
}
And in your store
mutations:{
TEST_COMMIT( state, payload ){
state.test=payload;
}
}
Now, when you change the value of the input parameter associated with the test, it will cause a commit to the store, which will update its state.
source
share