Electron——8.5.5升級到15.2.0


前言

因為要用到新版本的一些API,所以進行了electron版本的升級,項目基於electron-vue-template進行開發;

內容

安裝最新長期維護版本的electron

npm install --save electron@15.3.0

我當時直接修改了package.json中版本的信息,執行了npm i electron的命令,哈哈哈哈

Browserslist: caniuse-lite is outdated

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Could not detect abi for version 15.3.0 and runtime electron

Could not detect abi for version 15.3.0 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron
npm install node-abi

process is not defined | module is not defined

 mainWindow = new BrowserWindow({
    ......
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
      .....
    }
  })

https://www.electronjs.org/zh/docs/latest/api/context-bridge#isolated-world

An object could not be cloned

渲染進程中的IPC封裝有問題,按文檔修改后即可

https://www.electronjs.org/zh/docs/latest/api/ipc-main#ipcmainonchannel-listener


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM