index.js 771 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. const { Application } = require('ee-core');
  2. class App extends Application {
  3. constructor() {
  4. super();
  5. }
  6. /**
  7. * core app have been loaded
  8. */
  9. async ready () {
  10. // do some things
  11. }
  12. /**
  13. * electron app ready
  14. */
  15. async electronAppReady () {
  16. // do some things
  17. }
  18. /**
  19. * main window have been loaded
  20. */
  21. async windowReady () {
  22. // do some things
  23. // 延迟加载,无白屏
  24. const winOpt = this.config.windowsOption;
  25. if (winOpt.show == false) {
  26. const win = this.electron.mainWindow;
  27. win.once('ready-to-show', () => {
  28. win.show();
  29. })
  30. }
  31. }
  32. /**
  33. * before app close
  34. */
  35. async beforeClose () {
  36. // do some things
  37. }
  38. }
  39. App.toString = () => '[class App]';
  40. module.exports = App;