import Cookies from 'js-cookie'
import router from "./router";
import 'normalize.css/normalize.css' // a modern alternative to CSS resets

import noAuth from './components/NoAuth/index.vue'
// import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
import "element-ui/lib/theme-chalk/display.css";
import "./styles/element-variables.scss";

import './styles/index.scss' // global css
import globalComponents from './components/global'
// import tableRow from "./components/tree-table/row"
import App from './App'
import store from './store'
import base from './assets/utils/prototype/index'
import './icons' // icon
// import "./permission"; // 权限控制
import './utils/error-log' // error log

import * as filters from './filters' // global filters

Array.prototype.remove = function (val) {
  var index = this.indexOf(val);
  if (index > -1) {
    this.splice(index, 1);
  }
};
// 兼容
if (typeof String.prototype.startsWith != "function") {
  String.prototype.startsWith = function (prefix) {
    return this.slice(0, prefix.length) === prefix;
  };
}
// 暂无权限
Vue.component('noAuth', noAuth)
Vue.use(globalComponents)
// Vue.use(tableRow)
Vue.use(base)
import PuzzleVerification from 'vue-puzzle-verification'
import Vue from 'vue';
Vue.use(PuzzleVerification)


// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false
// Vue.use(ElementUI)
window.vm = new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
