const { app , BrowserWindow , Menu , Tray , shell , dialog , ipcMain } = require('electron') var parseCommand = function() { dialog.showMessageBox({ title : '錯誤' , type : 'error' , message : '此文件沒有跟 OnceDoc 綁定' }) } var initApp = function() { parseCommand() } app.on('ready', initApp)
參考資料:http://www.jb51.net/article/113856.htmjavascript