Files
electron-egg/main.js
哆啦好梦 8006b8cb94 恢复
2023-04-14 19:32:51 +08:00

50 lines
821 B
JavaScript

const { Application } = require('ee-core');
const EE = require('ee-core/ee');
class Main extends Application {
constructor() {
super();
// this === eeApp;
}
/**
* core app have been loaded
*/
async ready () {
// do some things
}
/**
* electron app ready
*/
async electronAppReady () {
// do some things
}
/**
* main window have been loaded
*/
async windowReady () {
// do some things
// 延迟加载,无白屏
const winOpt = this.config.windowsOption;
if (winOpt.show == false) {
const win = this.electron.mainWindow;
win.once('ready-to-show', () => {
win.show();
})
}
}
/**
* before app close
*/
async beforeClose () {
// do some things
}
}
// Instantiate an app object
EE.app = new Main();