Files
vue3-element-admin/src/main.ts
haoxr b127b3d97b refactor: 移除default-passive-events、字典方法重命名和pinia全局挂载方式优化
Former-commit-id: cde13acdb3068bca126a46b9684d0f0e82c46ac8
2022-12-18 13:26:43 +08:00

39 lines
947 B
TypeScript

import { createApp, Directive } from 'vue';
import App from './App.vue';
import router from '@/router';
import { setupStore } from '@/store';
import ElementPlus from 'element-plus';
import 'element-plus/theme-chalk/index.css';
import Pagination from '@/components/Pagination/index.vue';
import '@/permission';
// 引入svg注册脚本
import 'virtual:svg-icons-register';
// 国际化
import i18n from '@/lang/index';
// 自定义样式
import '@/styles/index.scss';
const app = createApp(App);
// 自定义指令
import * as directive from '@/directive';
Object.keys(directive).forEach(key => {
app.directive(key, (directive as { [key: string]: Directive })[key]);
});
// 全局方法
import { getDictionaries } from '@/api/dict';
app.config.globalProperties.$getDictionaries = getDictionaries;
// 全局挂载
setupStore(app);
app
.component('Pagination', Pagination)
.use(router)
.use(ElementPlus)
.use(i18n)
.mount('#app');