electron vue-cli 打包找不到系統(tǒng)托盤圖標(biāo)
默認(rèn)圖標(biāo)會放在根目錄的public文件夾下logo_1.ico
開發(fā)環(huán)境沒有問題,但是打包后就會報錯,找不到
// 設(shè)置系統(tǒng)托盤圖標(biāo)
const iconPath = path.join(__dirname, './bundled/logo_1.ico');
const appTray = new Tray(iconPath);
正確設(shè)置
// 設(shè)置系統(tǒng)托盤圖標(biāo)
const iconPath = path.join(__static, './logo_1.ico');
const appTray = new Tray(iconPath);