【发布时间】:2019-08-05 02:53:35
【问题描述】:
在关闭我的 Electron 应用程序时继续运行。 这是我的代码:
label: 'Close', click() {
app.quit()
}
window.on('close', function (e) {
var choice = require('electron').dialog.showMessageBox(this,
{
type: 'question',
buttons: ['Yes', 'No'],
title: 'Confirm',
message: 'Are you sure you want to quit?'
});
if (choice == 1) {
e.preventDefault();
}
})
我做错了什么?
【问题讨论】: