forked from hktuto/v-form-designer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-render.js
46 lines (38 loc) · 1.13 KB
/
install-render.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
42
43
44
45
46
import axios from 'axios'
import VFormRender from '@/components/form-render/index.vue'
import ContainerItems from '@/components/form-render/container-item/index'
import {registerIcon} from '@/utils/el-icons'
import 'virtual:svg-icons-register'
import '@/iconfont/iconfont.css'
import { installI18n } from '@/utils/i18n'
import { loadExtension } from '@/extension/extension-loader'
import { loadDataExtension } from '@/extension/dataField-loader'
VFormRender.install = function (app) {
installI18n(app)
loadExtension(app)
loadDataExtension(app)
app.use(ContainerItems)
registerIcon(app)
app.component(VFormRender.name, VFormRender)
}
const components = [
VFormRender
]
const install = (app) => {
installI18n(app)
loadExtension(app)
loadDataExtension(app)
app.use(ContainerItems)
registerIcon(app)
components.forEach(component => {
app.component(component.name, component)
})
window.axios = axios
}
if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时赋值axios!! */
//window.axios = axios
}
export default {
install,
VFormRender
}