import Vue from 'vue';
import App from './App.vue';
import store from './store/index';
import router from './router/index';
import 'animate.css';

import '@/cool';
import '@/service/index';
import '@/mock/index';
import '@/icons/index';
import '@/filter/index';
import '@/config/config';

import crud from 'cl-crud';

import ElementUI from 'element-ui';
import './assets/css/element-variables.scss';

import '@/assets/iconfont/iconfont.css';

import util from '@/utils/util';
Vue.prototype.$util = util;

Vue.use(ElementUI);

Vue.use(crud, {
	crud: {
		dict: {
			// 搜索
			search: {
				keyWord: 'search' // 模糊查询的关键字
			},
			// 分页参数
			pagination: {
				page: 'page', // 页数
				size: 'pageSize' // 每页显示的条目
			}
		},
		search: {
			key: {
				placeholder: '昵称 / 手机号'
			}
		},
		fn: {
			permission(that) {
				// const { permission } = that.$store.state.menu;
				// const { add, delete: del, update } = that.service.permission;

				// that.permission = {
				return {
					// add: permission.includes(add),
					// delete: permission.includes(del),
					// update: permission.includes(update)
					add: true,
					delete: true,
					update: true
				};
			}
		}
	}
});

Vue.config.productionTip = false;

new Vue({
	router,
	store,
	render: h => h(App)
}).$mount('#app');
