variant-form/install-render.js
2023-03-20 14:43:23 +08:00

30 lines
610 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import VFormRender from '@/components/form-render/index.vue'
import {loadExtension} from "@/extension/extension-loader"
import axios from "axios"
loadExtension()
VFormRender.install = function (Vue) {
Vue.component(VFormRender.name, VFormRender)
}
const components = [
VFormRender
]
const install = (Vue) => {
window.axios = axios
components.forEach(component => {
Vue.component(component.name, component)
})
}
if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时主动调用install方法 */
install(window.Vue);
}
export default {
install,
VFormRender
}