mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-06-12 17:01:05 +08:00
3.1.0
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
/**
|
||||
* 加密配置
|
||||
* @param type - confusion | bytecode | strict
|
||||
*/
|
||||
module.exports = {
|
||||
type: 'bytecode',
|
||||
directory: [
|
||||
'electron'
|
||||
type: 'confusion',
|
||||
files: [
|
||||
'electron/**/*.(js|json)',
|
||||
'!electron/config/encrypt.js',
|
||||
'!electron/config/nodemon.json'
|
||||
],
|
||||
cleanFiles: [
|
||||
'electron',
|
||||
],
|
||||
fileExt: ['.js'],
|
||||
confusionOptions: {
|
||||
|
||||
48
electron/index.js
Normal file
48
electron/index.js
Normal file
@@ -0,0 +1,48 @@
|
||||
const { Application } = require('ee-core');
|
||||
|
||||
class App extends Application {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
App.toString = () => '[class App]';
|
||||
module.exports = App;
|
||||
50
main.js
50
main.js
@@ -1,51 +1,5 @@
|
||||
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
|
||||
|
||||
}
|
||||
}
|
||||
const App = require('./electron');
|
||||
|
||||
// Instantiate an app object
|
||||
EE.app = new Main();
|
||||
|
||||
EE.app = new App();
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ee",
|
||||
"version": "3.0.1",
|
||||
"version": "3.1.0",
|
||||
"description": "A fast, desktop software development framework",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
@@ -27,6 +27,7 @@
|
||||
"build-lp-64": "electron-builder -l=pacman --x64",
|
||||
"rd": "ee-core rd --dist_dir=./frontend/dist",
|
||||
"encrypt": "ee-core encrypt",
|
||||
"clean": "ee-core clean",
|
||||
"rebuild": "electron-rebuild",
|
||||
"re-sqlite": "electron-rebuild -f -w better-sqlite3"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user