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 Loading from 'vue-loading-easy'

import './icons' // icon
import './permission' // permission control
import * as filters from './filters' // global filters
import moment from "moment"
//表格宽度自适应
import AFTableColumn from 'af-table-column'

Vue.use(Element, {
  size: Cookies.get('size') || 'medium', // set element-ui default size
})
Vue.use(AFTableColumn)
Vue.use(Loading)
// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
Vue.prototype.$moment = moment;
Vue.config.productionTip = false
//引入flexible
import './utils/flexible.js'
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App),
  beforeCreate() {
      //此时这个this就是vm，只不过这个时候还并没有去解析模版
      Vue.prototype.$bus = this; //安装全局事件总线
  }
})
