import Vue from 'vue'
import Cookies from 'js-cookie'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import Element from 'element-ui'
import './styles/element-variables.scss'
import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'
import './icons' // icon
import './permission' // permission control
import './utils/error-log' // error log
import * as filters from './filters' // global filters
import * as echarts from 'echarts'
import Loading from 'vue-loading-easy'
import moment from "moment"
import { mixin } from '@/mixin'
import './utils/flexible'
//表格宽度自适应
import AFTableColumn from 'af-table-column'
Vue.use(Element, {
  size: Cookies.get('size') || 'medium', // element-ui default size
})
Vue.use(AFTableColumn)
Vue.use(Loading)
Vue.mixin(mixin)
// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
Vue.prototype.$echarts = echarts
Vue.prototype.$moment = moment;
Vue.config.productionTip = false
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App),
  beforeCreate() {
      //此时这个this就是vm，只不过这个时候还并没有去解析模版
      Vue.prototype.$bus = this; //安装全局事件总线
  }
})
