[Vue warn]: Computed property "username" was assigned to but it has no setter.
因为你将从username是从vuex中获取的,你又双向把绑定到了页面上,但是从计算属性方面只获取操作,没有赋值操作,加上就ok。
computed: { username:{ get(){ return this.$store.state.username }, set(val){ this.$store.commit('setUsername', val) } } }
Be good all the time

浙公网安备 33010602011771号