Open
Description
在严格模式下直接使用确实会有问题。
解决方案:
<input v-model="message" />
computed: {
message: {
set (value) {
this.$store.dispatch('updateMessage', value);
},
get () {
return this.$store.state.obj.message
}
}
}
mutations: {
UPDATE_MESSAGE (state, v) {
state.obj.message = v;
}
}
actions: {
update_message ({ commit }, v) {
commit('UPDATE_MESSAGE', v);
}
}