vue 将值存储到vuex 报错问题

报错 :Vuex - Computed property “name” was assigned to but it has no setter

如何解决:

 

 

computed: {
addModal: {
get: function () {
return this.$store.state.addModal
},
set: function (newValue) {
this.$store.state.addModal = newValue
}
}
},

 

设置一个set

posted @ 2018-01-19 13:29  daidai201  阅读(318)  评论(0编辑  收藏  举报