/*
 * @Author: your name
 * @Date: 2022-01-04 15:14:05
 * @LastEditTime: 2022-01-08 15:15:00
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \goldenPig\src\main.js
 */
import Vue from 'vue'
import App from './App.vue'
import store from './store'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
import { hasBtnPermission } from './utils/permission';
import { Modal } from 'ant-design-vue';
import './assets/ttf/font.css';
import echart from 'echarts';
import {directiveLocationFormat} from '@/directives/location-format'

Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.use(Modal);
Vue.use(directiveLocationFormat)
Vue.prototype.hasPerm = hasBtnPermission
Vue.prototype.$echarts = echart

router.beforeEach((to, from, next) => {
  next();
  document.body.scrollTop = 0;
  document.getElementById('operant') && (document.getElementById('operant').scrollTop = 0);
  document.documentElement.scrollTop = 0;
  // 兼容ie
  window.scrollTo(0 ,0);
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
