From 18e1a6168a40c76ead73d02c4d0f2dce72c503ea Mon Sep 17 00:00:00 2001 From: jwai Date: Sun, 13 Oct 2024 07:33:47 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20src/main.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main.ts b/src/main.ts index e0c3d26..2f01f5c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,21 +5,23 @@ document.head.appendChild(meta); import "./styles/style.css"; import "./styles/color.less"; import "animate.css"; -import { registerPlugins } from "./plugins"; + +import { createApp } from 'vue' +import App from './App.vue' + +import naive from 'naive-ui' + import router from "./router"; +import { registerPlugins } from "./plugins"; +const app = createApp(App) -import App from "./App.vue"; -import { createApp } from "vue"; - -const app = createApp(App); - +app.use(naive) registerPlugins(app); + app.use(router); - -// @ts-ignore ... if (process.env.NODE_ENV === "production") { setTimeout(() => { const appContainer = document.getElementById("app"); @@ -28,7 +30,6 @@ if (process.env.NODE_ENV === "production") { } setTimeout(() => { const defaultLoader = document.getElementById("default-loader"); - // remove defaultLoader?.remove(); }, 300); @@ -36,7 +37,9 @@ if (process.env.NODE_ENV === "production") { app.mount("#app"); }, 300); setTimeout(() => { - appContainer!.style.opacity = "1"; + if (appContainer) { + appContainer.style.opacity = "1"; + } }, 300); }, 200); } else {