随笔分类 - Electron技能
electron 技巧积累
该文被密码保护。
摘要:1, 有的时候需要监听Electron的系统恢复事件(从睡眠、休眠中恢复,或者从锁屏状态恢复),这个时候我们会使用Electron主进程powerMonitor模块的resume事件或者unlock-screen事件。如下代码所示: let {powerMonitor} = require("ele
阅读全文
摘要:1, c = new o({ width: 300, height: 10, center:true, "kiosk": false,//是否使用kiosk模式。若是使用kiosk模式,应用程序将全屏显示,而且阻止用户离开应用。true or false maximizable: false, //
阅读全文
摘要:1, // 打开软件时 闪烁图标 // c.once('focus', () => c.flashFrame(true)); // c.flashFrame(true);
阅读全文
摘要:1, // 设置全局可以穿透效果 // c.setIgnoreMouseEvents(true); // 设置区域穿透效果 let win = require('electron').remote.getCurrentWindow() let el = document.getElementById
阅读全文
摘要:1,全屏效果下,二级页面置顶效果 要用 这两个才行 screen-saverpop-up-menu c.setAlwaysOnTop(true, "screen-saver", 1); 2,
阅读全文
摘要:1,获取当前启动exe所在目录地址 a = path.join(process.cwd(),"/resources/app/modelconvert64.exe ") 2, 穿透效果 让透明的窗口可点击穿透(鼠标事件作用于原生桌面) setIgnoreMouseEvents 设置为 true win
阅读全文
摘要:1,方法一,在ele中加如下代码 //在Electron中直接使用JQuery if (typeof module 'object') {window.jQuery = window.$ = module.exports;}; 如果报错可以这样写: if (typeof module 'object
阅读全文
该文被密码保护。