import Vue from "vue";
import Element from "element-ui";

import Cookies from "js-cookie";

import "normalize.css/normalize.css"; // a modern alternative to CSS resets
import "./styles/element-variables.scss";
import "@/styles/global.scss";
import "@/styles/index.scss"; // global css
import Print from 'vue-print-nb'
//import Print from './assets/print'
import 'default-passive-events';
Vue.use(Print);

import App from "./App";
import store from "./store";
import router from "./router";
import { moveToError } from "@/utils/utils.js";
import "./icons"; // icon
import "./permission"; // permission control
import "./utils/error-log"; // error log
import promise from "es6-promise";
import "babel-polyfill";
promise.polyfill();

import { message } from "@/utils/resetMessage.js";

import { hasBtnPermission } from "./utils/permission"; // button permission
Vue.prototype.hasPerm = hasBtnPermission;
Vue.prototype.$scrollToError = moveToError;
Vue.use(Element, {
  size: Cookies.get("size") || "small" // set element-ui default size
  //locale: zhLang // 如果使用中文，无需设置，请删除
});
Vue.prototype.$message = message;

Vue.config.productionTip = false;
Vue.config.silent = true;
new Vue({
  el: "#app",
  router,
  store,
  render: h => h(App)
});
