import Vue from 'vue'
import App from './App'
import router from './router'
import Axios from "axios"

// element - ui按需引入
import {
	Row, Col, Upload, Button, Select, Input, Menu, MenuItem, Form, FormItem, DatePicker, Table, TableColumn, Pagination, Dialog, Option, Message, MessageBox, Tabs, TabPane, Loading
} from 'element-ui';

// 注册使用element - ui组件
Vue.use(Row)
Vue.use(Col)
Vue.use(Upload)
Vue.use(Button)
Vue.use(Select)
Vue.use(Input)
Vue.use(Menu)
Vue.use(MenuItem)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(DatePicker)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Option)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Loading.directive);
Vue.prototype.$loading = Loading.service;

Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$message = Message;

Vue.prototype.$axios = Axios;

Vue.config.productionTip = false

Vue.directive('fo', {
	inserted(el, binding, vnode) {
		// 聚焦元素
		el.querySelector('input').focus()
	}
})

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