electron 中使用 nightmare

2021-01-16  本文已影响0人  w_w_wei

参考资料:
https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/648629/

当前遇到的问题

  1. node版本过高可能导致编译失败
    推荐使用 v10.16.0

  2. 代码中重写 onbeforeunload 事件,可能导致异常
    修改文件, node_modules\eramthgin\lib\preload.js
    将其中 writable 修改为true

  // prevent 'onunload' and 'onbeforeunload' from being set
  Object.defineProperties(window, {
    onunload: {
      enumerable: true,
      writable: false,
      value: null
    },
    onbeforeunload: {
      enumerable: true,
      writable: true,
      value: null
    }
  });

通信

https://ithelp.ithome.com.tw/articles/10235110?sc=iThomeR

electron-vue

https://simulatedgreg.gitbooks.io/electron-vue/content/cn/

上一篇 下一篇

猜你喜欢

热点阅读