美文网首页
electron-vue 中 vuex 赋值失败的问题

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

作者: 码码虎呼 | 来源:发表于2021-03-05 09:51 被阅读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'
    

    再次运行,赋值成功!

    相关文章

      网友评论

          本文标题:electron-vue 中 vuex 赋值失败的问题

          本文链接:https://www.haomeiwen.com/subject/mulqqltx.html