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';

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

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

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