computed: { test: { get () { return this.$store.state.test }, set (val) { this.$store.commit('setTest', val) } } }
vuex的数据快速绑定到v-model上面
<input v-model="test">
JS:
computed: { test: { get () { return this.$store.state.test }, set (val) { this.$store.commit('setTest', val) } } }
computed: { test: { get () { return this.$store.state.test }, set (val) { this.$store.commit('setTest', val) } } }