variant-form/install.js

42 lines
883 B
JavaScript
Raw Permalink Normal View History

2021-09-23 09:35:06 +00:00
import axios from 'axios'
import VFormDesigner from '@/components/form-designer/index.vue'
import VFormRender from '@/components/form-render/index.vue'
import {loadExtension} from "@/extension/extension-loader"
2021-09-23 09:35:06 +00:00
import '@/utils/directive'
import '@/icons'
import '@/iconfont/iconfont.css'
loadExtension()
2021-09-23 09:35:06 +00:00
VFormDesigner.install = function (Vue) {
Vue.component(VFormDesigner.name, VFormDesigner)
}
VFormRender.install = function (Vue) {
Vue.component(VFormRender.name, VFormRender)
}
const components = [
VFormDesigner,
VFormRender
]
const install = (Vue) => {
window.axios = axios
2021-09-23 09:35:06 +00:00
components.forEach(component => {
Vue.component(component.name, component)
})
}
if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时主动调用install方法 */
install(window.Vue);
}
export default {
install,
VFormDesigner,
VFormRender
}