import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import {axios} from './service/api/index'
import directives from './directives'
import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'

import vueGicHeader from '@gic-test/vue-gic-header'
import vueGicFooter from '@gic-test/vue-gic-footer'

import vueGicAsideMenu from '@/components/aside-menu'


import vueGicStoreLinkage from '@gic-test/vue-gic-store-linkage/src/lib'
import install from 'packele'
import preview from 'vue-photo-preview/src/lib/index.js'
import 'vue-photo-preview/dist/skin.css'
import dmConfirm from './components/dm-confirm'

//删除组件 这个组件常用，放到这不用在组件里引入
Vue.component(dmConfirm.name,dmConfirm)

Vue.config.productionTip = false
Vue.use(preview)
Vue.use(install)
Vue.use(ElementUI)
Vue.use(vueGicHeader)
Vue.use(vueGicFooter)
Vue.use(vueGicAsideMenu)
Vue.use(vueGicStoreLinkage)

Vue.prototype.axios = axios;
Vue.prototype.axios.withCredentials = true
Object.keys(directives).map(item => Vue.directive(item, directives[item]));
window.$bus = new Vue();
let flag = false
Vue.prototype.$tips = function ({message = '提示',type = 'success'}) {
  if (flag) { return }
  else {this.$message({message,type})}
  flag = true;
  setTimeout(_ => {flag  = false},1000)
}
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
