globalVuePlugins.js 600 B

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