main.js 项目入口文件及生命周期
# 引入框架核心 ee-core
const Appliaction = require('ee-core').Appliaction;
# main类
class Main extends Appliaction {
constructor() {
super();
// this对象等于ee框架的全局app对象
}
/**
* core app have been loaded
* 框架核心功能加载完成
*/
async ready () {
// do some things
}
/**
* electron app ready
* Electron完成初始化,主窗口创建之前
*/
async electronAppReady () {
// do some things
}
/**
* main window have been loaded
* 主窗口创建完成
*/
async windowReady () {
// do some things
}
/**
* before app close
* app退出之前
*/
async beforeClose () {
// do some things
}
}
// 实例化
new Main();