【发布时间】:2016-12-20 07:15:08
【问题描述】:
我说使用 Electron 并尝试制作最小化和关闭按钮。
index.html
<button id="minus" onclick="minimize()">minimize</span></button>
<button id="close" onclick="close()">close</span></button>
index.js
const remote = require('electron').remote;
function minimize(){
var window = remote.getCurrentWindow();
window.minimize();
}
function close(){
var window = remote.getCurrentWindow();
window.close();
}
我一定是犯了一些愚蠢的错误,或者什么,但最小化按钮在关闭按钮不起作用时完美地工作。
我也尝试过这里提到的 EventListener 方法 Atom Electron - Close the window with javascript 而且效果很好,但是为什么我的函数方法不起作用??
【问题讨论】:
标签: javascript electron