53 lines
1.8 KiB
TypeScript
53 lines
1.8 KiB
TypeScript
// src/main.ts
|
|
import { createApp } from "vue";
|
|
import "./style.css";
|
|
import ElementPlus from "element-plus";
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
|
|
//import VueAxios from 'vue-axios'
|
|
import 'element-plus/theme-chalk/el-message.css'//全局 Message 消息提示(js文件中使用不支持自动导入的样式)
|
|
import "element-plus/theme-chalk/el-message-box.css";// messageBox的样式
|
|
import "element-plus/theme-chalk/el-overlay.css";// 遮罩层样式
|
|
import "element-plus/theme-chalk/el-loading.css";// loading的样式
|
|
import "element-plus/theme-chalk/el-notification.css";//Notification的样式
|
|
|
|
//import 'element-plus/dist/index.css'//全部引入
|
|
import 'element-plus/es/components/form/style/css'//script setup中使用组件时不支持自动导入的样式
|
|
import 'element-plus/theme-chalk/el-affix.css'//全局 固钉
|
|
|
|
import ElTableInfiniteScroll from "el-table-infinite-scroll";
|
|
|
|
import App from "./App.vue";
|
|
// 引入Vue-Router
|
|
import Router from "./router";
|
|
// 引入Vue-i18n
|
|
import i18n from "./lang";
|
|
// Element Plus全局配置国际化
|
|
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
|
|
import en from "element-plus/dist/locale/en.mjs";
|
|
// 导入请求拦截器
|
|
import axiosInstance from '@/utils/http'//导入请求拦截器request
|
|
const app = createApp(App);
|
|
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
app.component(key, component)
|
|
}
|
|
//axios
|
|
app.config.globalProperties.$axios=axiosInstance;
|
|
|
|
app.use(ElementPlus, {
|
|
// locale: zhCn,
|
|
locale: localStorage.getItem("locale") === "zh_CN" ? zhCn : en,
|
|
});
|
|
app.use(Router);
|
|
app.use(i18n);
|
|
app.use(ElTableInfiniteScroll);
|
|
|
|
|
|
// 注册所有图标
|
|
import 'virtual:svg-icons-register'; // 引入注册脚本
|
|
import SvgIcon from '@/components/SvgIcon/index.vue';
|
|
app.component('SvgIcon', SvgIcon);
|
|
|
|
//app.provide('$echarts', echarts);
|
|
app.mount("#app");
|