You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
import App from "./App.vue";
|
|
import { createApp } from "vue";
|
|
import { createI18n } from 'vue-i18n'
|
|
// 引入路由实例
|
|
import router from "@/router/index.js";
|
|
//全局引入lodash
|
|
import _, { size } from "lodash";
|
|
//全局引入lodash
|
|
import dayjs from "dayjs";
|
|
// 引入css
|
|
import "@/assets/css/base.scss";
|
|
//全局引入element-plus组件库,方便修改配置,也可以在vite.config.js中动态引入
|
|
import ElementPlus from 'element-plus'
|
|
//全局引入element-plus所有图标
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
|
import 'element-plus/dist/index.css'
|
|
//引入中英文的数据
|
|
import en from './assets/i18n/en.js'
|
|
import zh from './assets/i18n/zh.js'
|
|
|
|
const i18n = createI18n({
|
|
// something vue-i18n options here ...
|
|
locale: 'zh', // 设置默认的语音版本语言
|
|
messages: {
|
|
zh: { ...zh },
|
|
en: { ...en },
|
|
}
|
|
})
|
|
// Plugins
|
|
import vuetify from '@/plugins/vuetify.js'
|
|
|
|
const app = createApp(App);
|
|
i18n.install(app) // use不生效,install生效
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
app.component(key, component)
|
|
}
|
|
app.config.globalProperties.$_ = _; //挂载到app实例上
|
|
app.config.globalProperties.$dayjs = dayjs; //挂载到app实例上
|
|
app.use(ElementPlus, { zIndex: 3000, size: 'large' })
|
|
.use(vuetify) //vuetify
|
|
.use(router) //路由
|
|
.mount("#app");
|
|
|