From ebfe4307463224da2c8bc11aab305630d0e2265f Mon Sep 17 00:00:00 2001 From: lqtmcstudio Date: Sat, 3 Jan 2026 17:32:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BE=AE=E8=B0=83=E7=95=8C=E9=9D=A2;?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9C=80=E5=B0=8F=E5=AE=BD=E5=BA=A6+?= =?UTF-8?q?=E9=AB=98=E5=BA=A6;=E4=BF=AE=E5=A4=8D=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=99=A8=E9=9D=9E=E5=85=A8=E5=B1=8F=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist-electron/main.js | 9 ++ electron/main.ts | 11 +- src/App.vue | 136 ++++++++++++----------- src/components/layout/WindowControls.vue | 31 ------ 4 files changed, 88 insertions(+), 99 deletions(-) diff --git a/dist-electron/main.js b/dist-electron/main.js index d1753b9..6a78272 100644 --- a/dist-electron/main.js +++ b/dist-electron/main.js @@ -14,11 +14,20 @@ function createWindow() { win = new BrowserWindow({ // 🔧 禁用原生标题栏(无边框) frame: false, + // 设置窗口最小大小 + minWidth: 950, + minHeight: 700, + // 设置初始窗口大小 + width: 1e3, + height: 800, icon: path.join(process.env.VITE_PUBLIC, "electron-vite.svg"), webPreferences: { preload: path.join(__dirname$1, "preload.mjs") } }); + if (process.env.NODE_ENV === "development") { + win.webContents.openDevTools({ mode: "right" }); + } win.webContents.on("did-finish-load", () => { win == null ? void 0 : win.webContents.send("main-process-message", (/* @__PURE__ */ new Date()).toLocaleString()); }); diff --git a/electron/main.ts b/electron/main.ts index 4e84d0d..fb6572e 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -30,13 +30,22 @@ function createWindow() { win = new BrowserWindow({ // 🔧 禁用原生标题栏(无边框) frame: false, + // 设置窗口最小大小 + minWidth: 950, + minHeight: 700, + // 设置初始窗口大小 + width: 1000, + height: 800, icon: path.join(process.env.VITE_PUBLIC, 'electron-vite.svg'), webPreferences: { preload: path.join(__dirname, 'preload.mjs'), }, + }) - + if (process.env.NODE_ENV === 'development') { + win.webContents.openDevTools({ mode: 'right' }); // 可选:'undocked', 'bottom', 'right' + } // Test active push message to Renderer-process. win.webContents.on('did-finish-load', () => { win?.webContents.send('main-process-message', new Date().toLocaleString()) diff --git a/src/App.vue b/src/App.vue index 6b01b26..ffda61d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,5 @@