globalVuePlugins.js 576 B

123456789101112131415161718192021222324
  1. import { objAssign, randomCode, tableAction } from "@/plugins/utils";
  2. import globalMixins from "./mixins";
  3. import ViewFooter from "@/components/ViewFooter.vue";
  4. const components = {
  5. ViewFooter
  6. };
  7. export default {
  8. install: function(Vue) {
  9. // 实例方法
  10. Vue.prototype.$tableAction = tableAction;
  11. Vue.prototype.$objAssign = objAssign;
  12. Vue.prototype.$randomCode = randomCode;
  13. // 注册全局组件
  14. Object.keys(components).forEach(key => {
  15. Vue.component(key, components[key]);
  16. });
  17. //全局 mixins
  18. Vue.mixin(globalMixins);
  19. }
  20. };