You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
816 B

1 month ago
  1. const { app, BrowserWindow } = require('electron');
  2. const path = require('path')
  3. function createWindow() {
  4. const win = new BrowserWindow({
  5. width: 1200,
  6. height: 800,
  7. fullscreen:false,
  8. webPreferences: {
  9. nodeIntegration: true,
  10. contextIsolation: false
  11. }
  12. });
  13. // 最大化窗口
  14. win.maximize()
  15. win.setMenu(null);
  16. win.loadURL('http://127.0.0.1');
  17. // win.loadFile(path.join(__dirname, 'build', 'index.html'));
  18. // win.loadURL(resolveHtmlPath('index.html'));
  19. }
  20. app.whenReady().then(() => {
  21. createWindow();
  22. app.on('activate', function () {
  23. if (BrowserWindow.getAllWindows().length === 0) createWindow();
  24. });
  25. });
  26. app.on('window-all-closed', function () {
  27. if (process.platform!== 'darwin') app.quit();
  28. });