install-render.js 610 B

1234567891011121314151617181920212223242526272829
  1. import VFormRender from '@/components/form-render/index.vue'
  2. import {loadExtension} from "@/extension/extension-loader"
  3. import axios from "axios"
  4. loadExtension()
  5. VFormRender.install = function (Vue) {
  6. Vue.component(VFormRender.name, VFormRender)
  7. }
  8. const components = [
  9. VFormRender
  10. ]
  11. const install = (Vue) => {
  12. window.axios = axios
  13. components.forEach(component => {
  14. Vue.component(component.name, component)
  15. })
  16. }
  17. if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时主动调用install方法!! */
  18. install(window.Vue);
  19. }
  20. export default {
  21. install,
  22. VFormRender
  23. }