最新版本的 uuid 使用
const { v4: uuidv4 } = require('uuid');
const { v4: uuidv4 } = require('uuid');
2020-03-25
新版本的 showOpenDialog 已經(jīng)使用了promise,不能再用回掉函數(shù),用.then 來獲取.then((res) => {
console.log(res);
});
console.log(res);
});
2020-03-20
electron-builder 22.3.6版本需要將package.json中scripts的dist改成electron-builder,否則build command not found.
2020-03-06
我記得沒暴露過自己的名字啊 發(fā)現(xiàn)自己的名字出現(xiàn)在右側(cè) 但是這個頭像我沒用過啊 天啊 這個老師的名字和我同名同姓!中國有30W個張偉 現(xiàn)在叫張軒的也多起來了嘛。。
2020-02-09
我的解決方法是不用class繼承了,只是封裝一個創(chuàng)建BrowserWindow實例的方法,這樣也可以達到代碼復用的效果
2019-12-28
老師,我在跟著這節(jié)課做的時候,一直報錯,查了很久的原因,發(fā)現(xiàn)是electron的BrowserWindow不支持繼承了,官方解釋在這里:
https://github.com/electron/electron/issues/23#issuecomment-19613241
老師記得提醒同學們。
https://github.com/electron/electron/issues/23#issuecomment-19613241
老師記得提醒同學們。
2019-12-28
最后文件的路徑不顯示的,用以下代碼,
ipcMain.on('open-music-file', () => {
dialog.showOpenDialog({
properties: ['openFile', 'multiSelections'],
filters: [{ name: 'Music', extensions: ['mp3'] }]
}).then(result => {
console.log(result.filePaths)
})
})
ipcMain.on('open-music-file', () => {
dialog.showOpenDialog({
properties: ['openFile', 'multiSelections'],
filters: [{ name: 'Music', extensions: ['mp3'] }]
}).then(result => {
console.log(result.filePaths)
})
})
2019-11-27