mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 03:52:07 +08:00
54 lines
794 B
JavaScript
54 lines
794 B
JavaScript
const Appliaction = require('ee-core').Appliaction;
|
|
const { app } = require('electron');
|
|
|
|
|
|
class Main extends Appliaction {
|
|
|
|
constructor() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* core app have been loaded
|
|
*/
|
|
async ready () {
|
|
// do some things
|
|
}
|
|
|
|
/**
|
|
* main window have been loaded
|
|
*/
|
|
async windowReady () {
|
|
// do some things
|
|
|
|
// const app = this;
|
|
// // preload预加载模块
|
|
// const preload = require('./electron/preload');
|
|
// preload(app);
|
|
|
|
}
|
|
|
|
startEggCluster (options) {
|
|
return new Promise((resolve, reject) => {
|
|
console.log('op:', options);
|
|
startCluster(options, function(){
|
|
resolve('success');
|
|
});
|
|
});
|
|
}
|
|
|
|
/**
|
|
* before app close
|
|
*/
|
|
async beforeClose () {
|
|
// do some things
|
|
|
|
}
|
|
}
|
|
|
|
new Main();
|
|
|
|
|
|
|
|
|
|
|