import { objAssign, randomCode, tableAction } from "@/plugins/utils";
import globalMixins from "./mixins";
import ViewHeader from "@/components/ViewHeader.vue";
import ViewFooter from "@/components/ViewFooter.vue";

const components = {
  ViewFooter,
  ViewHeader
};

export default {
  install: function(Vue) {
    // 实例方法
    Vue.prototype.$tableAction = tableAction;
    Vue.prototype.$objAssign = objAssign;
    Vue.prototype.$randomCode = randomCode;

    // 注册全局组件
    Object.keys(components).forEach(key => {
      Vue.component(key, components[key]);
    });

    //全局 mixins
    Vue.mixin(globalMixins);
  }
};
