// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import "./util/development.js";
import "./base/base.css";
import "./components";
import "./theme/mix/mix.scss";
import "./base/refreshRem.js";

import Vue from "vue";
import App from "./App";
import router from "./router";
import fundebug from "fundebug-javascript";
fundebug.apikey =
  "643a8c754e86b417368e0ad49ef521d86a5dac5fc96201b628fa977491b632e4";
// import './navigation'
// import './api'
// import vconsole from 'vconsole'
Vue.config.productionTip = false;

if (process.env.NODE_ENV === "production") {
  // fundebug.silentVideo = false
  // 事件过滤 过滤掉一些不必要的错误
  fundebug.filters = window.errOptions;

  // 不监控资源的加载错误
  fundebug.silentResource = true;

  function formatComponentName(vm) {
    if (vm.$root === vm) return "root";

    var name = vm._isVue
      ? (vm.$options && vm.$options.name) ||
        (vm.$options && vm.$options._componentTag)
      : vm.name;
    return (
      (name ? "component <" + name + ">" : "anonymous component") +
      (vm._isVue && vm.$options && vm.$options.__file
        ? " at " + (vm.$options && vm.$options.__file)
        : "")
    );
  }

  Vue.config.errorHandler = function(err, vm, info) {
    var componentName = formatComponentName(vm);
    var propsData = vm.$options && vm.$options.propsData;

    fundebug.notifyError(err, {
      metaData: {
        componentName: componentName,
        propsData: propsData,
        info: info
      }
    });
  };
}

window.signUrl = window.location.href;

// var vConsole = new vconsole()

/* eslint-disable no-new */
new Vue({
  el: "#app",
  router,
  template: "<App/>",
  components: { App }
});
