wms-elevue/src/main.ts

44 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-07-05 09:31:54 +08:00
import './styles/tailwindbase.css';
import 'element-plus/dist/index.css';
import './styles/index.scss';
import 'element-plus/theme-chalk/display.css';
import 'element-plus/theme-chalk/dark/css-vars.css';
import 'nprogress/nprogress.css';
2024-07-08 19:24:07 +08:00
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
2024-07-05 09:31:54 +08:00
import { createApp } from 'vue';
import App from './App.vue';
import router, { setupRouter } from './router';
import { setupStore } from '@/store';
import { setupElement, setupDirectives, setupCustomComponents } from '@/plugins';
async function bootstrap() {
2024-07-08 19:24:07 +08:00
const app=createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
2024-07-05 09:31:54 +08:00
// 全局完整引入 element 组件
setupElement(app);
// 注册全局自定义组件
setupCustomComponents(app);
// 注册全局自定义指令v-permission权限指令
setupDirectives(app);
// 注册全局方法app.config.globalProperties.$message = message
//setupGlobalMethods(app);
// 挂载状态管理
setupStore(app);
// 挂载路由
await setupRouter(app);
// 路由准备就绪后挂载APP实例
await router.isReady();
app.mount('#app', true);
}
void bootstrap();