main.js 760 B

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