electron-vue 中 vuex 赋值失败的问题

2021-03-05  本文已影响0人  码码虎呼

文档中明确注明了:

In case if you enabled createSharedMutations() plugin you need to create an instance of store in the main process. To do it just add this line into your main process (for example src/main.js):
import ‘./path/to/your/store’

意思是:

如果你启用了这个插件,需要在主进程导出(export )store的实例。

于是在主进程中加上这一句:

import '../renderer/store'

再次运行,赋值成功!

上一篇 下一篇

猜你喜欢

热点阅读