From 582a63b79eeff2fdf082a6eeec9291f2d1fcb2cf Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Thu, 2 Apr 2026 22:20:11 +0800 Subject: [PATCH] fix(dashboard): mount pinia before router to avoid white screen on start --- dashboard/src/main.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dashboard/src/main.ts b/dashboard/src/main.ts index 76f7ddbc4..0f7fed83a 100644 --- a/dashboard/src/main.ts +++ b/dashboard/src/main.ts @@ -46,7 +46,7 @@ async function mountApp(app: any, pinia: any, waitForRouter = true) { app.mount("#app"); // 挂载后同步 Vuetify 主题 - const customizer = useCustomizerStore(); + const customizer = useCustomizerStore(pinia); vuetify.theme.change(customizer.uiTheme); const storedPrimary = localStorage.getItem("themePrimary"); const storedSecondary = localStorage.getItem("themeSecondary"); @@ -127,16 +127,17 @@ async function initApp() { // Suppress known Vuetify 4 internal warning about slot invocation app.config.warnHandler = (msg, _instance, _trace) => { - if (msg.includes("Slot \"default\" invoked outside of the render function")) return; + if (msg.includes('Slot "default" invoked outside of the render function')) + return; console.warn(msg); }; - app.use(router); const pinia = createPinia(); app.use(pinia); + app.use(router); const { useApiStore } = await import("@/stores/api"); - const apiStore = useApiStore(); + const apiStore = useApiStore(pinia); apiStore.setPresets(presets); apiStore.init();