forked from vform666/variant-form
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.js
41 lines (32 loc) · 883 Bytes
/
install.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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"
import '@/utils/directive'
import '@/icons'
import '@/iconfont/iconfont.css'
loadExtension()
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
components.forEach(component => {
Vue.component(component.name, component)
})
}
if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时主动调用install方法!! */
install(window.Vue);
}
export default {
install,
VFormDesigner,
VFormRender
}