feat(frontend): 添加 Vue 应用入口文件

- 添加 main.ts,初始化 Vue 应用、注册插件(Pinia、Router、Element Plus)
- 添加 App.vue,根组件
- 添加 env.d.ts,TypeScript 类型声明
This commit is contained in:
2026-07-14 15:39:05 +08:00
parent dd23e1844e
commit 2976e196f7
3 changed files with 40 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
<template>
<router-view />
</template>
<script setup lang="ts">
// 根组件
</script>
<style>
/* 全局样式已在 global.css 中定义 */
</style>
+7
View File
@@ -0,0 +1,7 @@
/// <reference types="vite/client" />
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}
+22
View File
@@ -0,0 +1,22 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import App from './App.vue'
import router from './router'
import './styles/global.css'
const app = createApp(App)
// 注册 Element Plus 图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
app.use(createPinia())
app.use(router)
app.use(ElementPlus)
app.mount('#app')