如何才能让<input>的v-model和vuex中的数据快速绑定上?
HTML:
<input v-model="test">
JS:
computed: { test: { get () { return this.$store.state.test }, set (val) { this.$store.commit('setTest', val) } } }
Be good all the time
HTML:
<input v-model="test">
JS:
computed: { test: { get () { return this.$store.state.test }, set (val) { this.$store.commit('setTest', val) } } }