From 38c1cf1236d568b31902a0b55f65e26124d2deae Mon Sep 17 00:00:00 2001 From: lyc Date: Wed, 17 Jul 2024 15:37:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.js | 1 + src/renderer/src/layout/index.vue | 2 +- src/renderer/src/views/login/index.vue | 2 +- src/renderer/src/views/resource/index.vue | 10 ++++++---- src/renderer/src/views/resource/store.js | 1 + 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 72d5a72..6cab157 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -107,4 +107,5 @@ ipcMain.on('close-window', () => { ipcMain.on('set-winsize', (e, {x, y})=>{ const win = BrowserWindow.getFocusedWindow(); win.setSize(x,y); + win.center() }) diff --git a/src/renderer/src/layout/index.vue b/src/renderer/src/layout/index.vue index dd659c9..646d279 100644 --- a/src/renderer/src/layout/index.vue +++ b/src/renderer/src/layout/index.vue @@ -16,7 +16,7 @@ import AppMain from './components/AppMain.vue' import Uploader from './components/Uploader.vue' const { ipcRenderer } = window.electron || {} -ipcRenderer.send('set-winsize', { x: 1200, y: 700 }) +ipcRenderer ? ipcRenderer .send('set-winsize', { x: 1200, y: 700 }) : ''