import Vue from 'vue'

import 'normalize.css/normalize.css'// A modern alternative to CSS resets

import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // global css

import App from './App'
import router from './router'
import store from './store'
import './icons' // icon
import './permission' // permission control
// import './mock' // simulation data
import { handleTree, resetForm } from '@/utils/index'
// 自定义表格工具组件
import RightToolbar from '@/components/RightToolbar'

import UIComponents from '@/ui-components'

Vue.use(Element, {
  size: 'medium' // set element-ui default size
})
Vue.use(UIComponents)
// 全局方法挂载
Vue.prototype.upLoadUrl = process.env.BASE_API + '/storage/create'
Vue.config.productionTip = false
Vue.prototype.handleTree = handleTree
Vue.prototype.resetForm = resetForm
// 全局组件挂载
Vue.component('RightToolbar', RightToolbar)

new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
