摘要: 1、主进程代码 1 let electron = require('electron') 2 const {ipcMain,BrowserWindow} = require('electron') 3 4 let app = electron.app //引用APP 5 let mainWindow 阅读全文
posted @ 2022-12-20 10:04 ziff123 阅读(61) 评论(0) 推荐(0)
摘要: 环境: "devDependencies": { "electron": "^22.0.0" }, "dependencies": { "@electron/remote": "^2.0.9", "log4js": "^6.7.1" } 1、安装: npm install log4js --save 阅读全文
posted @ 2022-12-18 21:38 ziff123 阅读(807) 评论(0) 推荐(0)
摘要: 写了个脚本,导出的时候报SyntaxError: Unexpected token 'export' 查一下发现是Node的导入导出规范跟浏览器ES6不太一样 将导出由 export{ xxx } 改成 module.exports = { xxx } 就可以 阅读全文
posted @ 2022-12-15 14:35 ziff123 阅读(795) 评论(0) 推荐(0)
摘要: 1、安装electron-packager // 全局安装 npm install -g electron-packager // 项目安装 npm install electron-packager -D 2、在package.json添直执脚本 "scripts": { "test": "ech 阅读全文
posted @ 2022-12-13 16:53 ziff123 阅读(87) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-12-13 14:41 ziff123 阅读(220) 评论(0) 推荐(0)
摘要: 一、知识点: global-shortcut 模块可以便捷的为您设置(注册/注销)各种自定义操作的快捷键. Note: 使用此模块注册的快捷键是系统全局的(QQ截图那种), 不要在应用模块(app module)响应 ready 消息前使用此模块(注册快捷键). Methods global-sho 阅读全文
posted @ 2022-12-13 14:20 ziff123 阅读(309) 评论(0) 推荐(0)
摘要: 一、知识点 在渲染进程中, Online and offline 事件检测,是通过标准 HTML5 API 中 navigator.onLine 属性来实现的。 脱机时 (从网络断开), navigator.onLine 属性将返回 false, 除此之外都返回true 。 由于所有其他条件都返回  阅读全文
posted @ 2022-12-13 11:20 ziff123 阅读(614) 评论(0) 推荐(0)
摘要: 一、知识点 dialog.showErrorBox(title, content) 展示一个传统的包含错误信息的对话框. + 在 app 模块触发 ready 事件之前,这个 api 可以被安全调用,通常它被用来在启动的早期阶段报告错误. 在 Linux 上,如果在 app 模块触发 ready 事 阅读全文
posted @ 2022-12-13 10:38 ziff123 阅读(458) 评论(0) 推荐(0)
摘要: 一、知识点 dialog.showMessageBox([browserWindow, ]options[, callback]) browserWindow BrowserWindow (可选) options Object type String - 可以是 "none", "info", "e 阅读全文
posted @ 2022-12-13 10:30 ziff123 阅读(1670) 评论(0) 推荐(0)
摘要: 一、知识点 dialog.showSaveDialog([browserWindow, ]options[, callback]) browserWindow BrowserWindow (可选) options Object title String defaultPath String filt 阅读全文
posted @ 2022-12-13 10:00 ziff123 阅读(1439) 评论(0) 推荐(0)