create-chuntianxiaozhu
Version:
春天小猪模板工具
50 lines (42 loc) • 857 B
JavaScript
const { Application } = require('ee-core');
const { initSyncModule } = require('./utils/mjsmodule');
class Index extends Application {
constructor() {
super();
}
/**
* core app have been loaded
*/
async ready () {
}
/**
* electron app ready
*/
async electronAppReady () {
// do some
await initSyncModule();
}
/**
* 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();
win.focus();
})
}
}
/**
* before app close
*/
async beforeClose () {
// do some things
}
}
Index.toString = () => '[class Index]';
module.exports = Index;