39 lines
934 B
TypeScript
39 lines
934 B
TypeScript
import { createApp, type Plugin } from "vue"
|
|
import errorHandler from '@utils/errorHandler'
|
|
|
|
// 引入 Element Plus 组件库
|
|
import ElementPlus from 'element-plus'
|
|
import locale from 'element-plus/es/locale/lang/zh-cn'
|
|
|
|
// 引入 i18n 插件
|
|
import i18n from '@renderer/i18n'
|
|
|
|
import Login from './index.vue'
|
|
|
|
// 样式文件隔离
|
|
import '@renderer/styles/index.css'
|
|
import 'element-plus/dist/index.css'
|
|
|
|
// 引入全局组件
|
|
import HeaderBar from '@components/HeaderBar/index.vue'
|
|
import DragRegion from '@components/DragRegion/index.vue'
|
|
|
|
const components: Plugin = (app) => {
|
|
app.component('HeaderBar', HeaderBar);
|
|
app.component('DragRegion', DragRegion);
|
|
}
|
|
|
|
// 创建 Vue 应用实例
|
|
const app = createApp(Login);
|
|
const pinia = createPinia();
|
|
|
|
// 使用 Pinia 状态管理
|
|
app.use(pinia);
|
|
app.use(ElementPlus, { locale })
|
|
app.use(components)
|
|
app.use(i18n)
|
|
app.use(errorHandler)
|
|
|
|
// 挂载应用到 DOM
|
|
app.mount("#app");
|