From 81a132f7b5d022e8d55dc1fefe2a7357f5bcbafa Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期一, 25 八月 2025 15:22:27 +0800 Subject: [PATCH] 首页 --- src/main.js | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..7909a47 --- /dev/null +++ b/src/main.js @@ -0,0 +1,34 @@ +import './assets/main.css' + +import { createApp } from 'vue' +import { createPinia } from 'pinia' + +import App from './App.vue' +// 瀹屾暣寮曞叆 Element Plus +import ElementPlus from 'element-plus' +import 'element-plus/dist/index.css' +import * as ElementPlusIconsVue from '@element-plus/icons-vue' +import router from './router' +import MG from '@/assets/js/middleGround/WebMiddleGroundApi.js' +import toolClass from '@/assets/js/toolClass.js' +import config from '@/assets/js/config.js' + +const app = createApp(App) + +app.provide('config', config) +app.provide('MG', MG) +app.provide('toolClass', toolClass) + +// 娉ㄥ唽鎵�鏈夊浘鏍� +for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component) +} +app.use(ElementPlus) +app.use(createPinia()) +app.use(router) +app.mount('#app') + +router.beforeEach((to, from, next) => { + window.scrollTo({ top: 0 }) // 灏嗘粴鍔ㄦ潯浣嶇疆璁句负0 + next() +}) -- Gitblit v1.9.1