7
我說使用電子,並試圖使盡量減少和關閉按鈕。原子電子關閉和最小化窗口使用HTML按鈕和JavaScript
的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 它的工作完美,但爲什麼我的函數方法不工作?