import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import './global.less';
import 'vue-awesome/icons'
import Icon from 'vue-awesome/components/Icon'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import VueDraggableResizable from 'vue-draggable-resizable'
import 'vue-draggable-resizable/dist/VueDraggableResizable.css'
Vue.component('v-icon', Icon);
Vue.use(ElementUI);
Vue.component('vue-draggable-resizable', VueDraggableResizable)
Vue.directive('enterInteger', {
inserted: function (el) {
el.addEventListener("keypress",function(e){
e = e || window.event;
let charcode = typeof e.charCode == 'number' ? e.charCode : e.keyCode;
let re = /\d/;
if(!re.test(String.fromCharCode(charcode)) && charcode > 9 && !e.ctrlKey){
if(e.preventDefault){
e.preventDefault();
}else{
e.returnValue = false;
}
}
});
}
});
const requireComponent = require.context(
"./components",
true,
/[A-Za-z0-9_]+\.(vue|js)$/
);
requireComponent.keys().forEach((fileName) => {
const componentConfig = requireComponent(fileName);
const componentName = fileName
.split("/")
.pop()
.replace(/\.\w+$/, "");
Vue.component(
componentName,
componentConfig.default || componentConfig
);
});
Vue.config.productionTip = false;
new Vue({
router,
store,
render: (h) => h(App),
}).$mount("#app");