electron-vue應用build後,開啟exe檔案安裝,成功後,開啟應用報錯
阿新 • • 發佈:2018-11-12
- 問題描述:
2.解決方法:
import {app, BrowserWindow, Menu, ipcMain, Tray,nativeImage} from 'electron' const path = require('path'); //... const iconPath = path.join(__dirname, '../../static/imgs/logo.ico') const emptyPath = path.join(__dirname, '../../static/imgs/empty.ico') //使用nativeImage.createFromPath方法!!! const trayUrl = nativeImage.createFromPath(iconPath); const emptyUrl = nativeImage.createFromPath(emptyPath); let tray = new Tray(trayUrl);
3.先看看本地dev有沒有問題,npm run dev;
npm run build; -> 開啟build檔案下的.exe檔案,按照引導安裝,成功後,桌面會有快捷方式