zl程序教程

您现在的位置是:首页 >  其他

当前栏目

vuex报错:‘xxx’was assigned to but it has no setter.

IT 报错 to No has xxx was Vuex
2023-09-14 09:04:07 时间

 

VM33737:37 [Vue warn]: Computed property "notificationSwitch" was assigned to but it has no setter.

found in

 解决办法:

我是因为在vuex里面已经定义了。但是在页面的方法里面却使用了this.xxx去定义的就是错的。

改成这样既可:

this.$store.commit('SET_NOTIFICATIONSWITCH',true)