2022-06-14 09:32:49 +08:00
|
|
|
|
/*
|
|
|
|
|
* @Author: hisense.wuhongjian
|
|
|
|
|
* @Date: 2022-03-29 17:48:03
|
2022-08-06 16:36:20 +08:00
|
|
|
|
* @LastEditors: hisense.wuhongjian
|
|
|
|
|
* @LastEditTime: 2022-08-06 15:00:49
|
2022-06-14 09:32:49 +08:00
|
|
|
|
* @Description: 告诉大家这是什么
|
|
|
|
|
*/
|
|
|
|
|
import { createApp } from 'vue'
|
|
|
|
|
import Antd from 'ant-design-vue'
|
|
|
|
|
import mitt from 'mitt'
|
|
|
|
|
import App from './App'
|
|
|
|
|
import router from './router'
|
|
|
|
|
import '/public/static/js/rem.js'
|
|
|
|
|
import store from './store'
|
|
|
|
|
import 'ant-design-vue/dist/antd.css'
|
|
|
|
|
import '@/vab'
|
|
|
|
|
import * as echarts from 'echarts'
|
|
|
|
|
import * as moment from 'moment'
|
2022-08-06 16:36:20 +08:00
|
|
|
|
import vue3videoPlay from 'vue3-video-play-emiyagm' // 引入组件
|
|
|
|
|
import 'vue3-video-play-emiyagm/dist/style.css' // 引入css
|
2022-06-14 09:32:49 +08:00
|
|
|
|
import ElementPlus from 'element-plus'
|
|
|
|
|
import 'element-plus/dist/index.css'
|
|
|
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
|
|
|
|
/**
|
|
|
|
|
* @author chuzhixin 1204505056@qq.com
|
|
|
|
|
* @description 正式环境默认使用mock,正式项目记得注释后再打包
|
|
|
|
|
*/
|
2022-07-21 18:39:19 +08:00
|
|
|
|
// if (process.env.NODE_ENV === 'production') {
|
|
|
|
|
// const { mockXHR } = require('@/utils/static')
|
|
|
|
|
// mockXHR()
|
|
|
|
|
// }
|
2022-06-14 09:32:49 +08:00
|
|
|
|
const emitter = mitt()
|
|
|
|
|
const app = createApp(App)
|
|
|
|
|
app.config.globalProperties.$emitter = emitter
|
|
|
|
|
app
|
|
|
|
|
.use(store)
|
|
|
|
|
.use(ElementPlus)
|
|
|
|
|
.use(router)
|
|
|
|
|
.use(echarts)
|
|
|
|
|
.use(vue3videoPlay)
|
|
|
|
|
.use(moment)
|
|
|
|
|
.use(Antd)
|
|
|
|
|
.use(ElementPlus)
|
|
|
|
|
.mount('#app')
|
|
|
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
|
|
|
app.component(key, component)
|
|
|
|
|
}
|
2022-07-05 16:20:11 +08:00
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
|
|
// console.log('跳转路由=========>', to, from, next)
|
|
|
|
|
document.documentElement.scrollTop = 0
|
|
|
|
|
document.body.scrollTop = 0
|
|
|
|
|
next()
|
|
|
|
|
})
|