Files
vue3-element-admin/src/main.ts
haoxr 50cc85bad3 feat: 暗黑模式临时提交
Former-commit-id: 8653f21636d0c32f48caae65a52aca98cbef8710
2023-01-16 00:48:55 +08:00

34 lines
865 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 '@/permission';
// 本地SVG图标
import 'virtual:svg-icons-register';
// 国际化
import i18n from '@/lang/index';
import '@/styles/index.scss';
import 'element-plus/theme-chalk/index.css';
import 'element-plus/theme-chalk/dark/css-vars.css';
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.use(router).use(ElementPlus).use(i18n).mount('#app');