2022-01-01 19:15:45 +08:00
|
|
|
|
import axios from 'axios'
|
|
|
|
|
|
|
|
|
|
import VFormDesigner from '@/components/form-designer/index.vue'
|
|
|
|
|
import VFormRender from '@/components/form-render/index.vue'
|
|
|
|
|
|
|
|
|
|
import Draggable from '@/../lib/vuedraggable/dist/vuedraggable.umd.js'
|
2022-01-16 15:18:25 +08:00
|
|
|
|
import {registerIcon} from '@/utils/el-icons'
|
2022-01-01 19:15:45 +08:00
|
|
|
|
import SvgIcon from '@/components/svg-icon' //svg组件
|
|
|
|
|
import 'virtual:svg-icons-register'
|
2022-01-16 15:18:25 +08:00
|
|
|
|
import '@/iconfont/iconfont.css'
|
2022-01-01 19:15:45 +08:00
|
|
|
|
|
|
|
|
|
import ContainerWidgets from '@/components/form-designer/form-widget/container-widget/index'
|
|
|
|
|
import ContainerItems from '@/components/form-render/container-item/index'
|
|
|
|
|
|
|
|
|
|
import { addDirective } from '@/utils/directive'
|
|
|
|
|
import { installI18n } from '@/utils/i18n'
|
|
|
|
|
import { loadExtension } from '@/extension/extension-loader'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VFormDesigner.install = function (app) {
|
|
|
|
|
addDirective(app)
|
|
|
|
|
installI18n(app)
|
|
|
|
|
loadExtension(app)
|
|
|
|
|
|
|
|
|
|
app.use(ContainerWidgets)
|
|
|
|
|
app.use(ContainerItems)
|
|
|
|
|
|
2022-01-16 15:18:25 +08:00
|
|
|
|
registerIcon(app)
|
2022-01-01 19:15:45 +08:00
|
|
|
|
app.component('draggable', Draggable)
|
|
|
|
|
app.component('svg-icon', SvgIcon)
|
|
|
|
|
app.component(VFormDesigner.name, VFormDesigner)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VFormRender.install = function (app) {
|
|
|
|
|
installI18n(app)
|
|
|
|
|
loadExtension(app)
|
|
|
|
|
|
|
|
|
|
app.use(ContainerItems)
|
|
|
|
|
|
2022-03-25 16:54:18 +08:00
|
|
|
|
registerIcon(app)
|
2022-01-01 19:15:45 +08:00
|
|
|
|
app.component('svg-icon', SvgIcon)
|
|
|
|
|
app.component(VFormRender.name, VFormRender)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const components = [
|
|
|
|
|
VFormDesigner,
|
|
|
|
|
VFormRender
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const install = (app) => {
|
|
|
|
|
addDirective(app)
|
|
|
|
|
installI18n(app)
|
|
|
|
|
loadExtension(app)
|
|
|
|
|
|
|
|
|
|
app.use(ContainerWidgets)
|
|
|
|
|
app.use(ContainerItems)
|
|
|
|
|
|
2022-03-25 16:54:18 +08:00
|
|
|
|
registerIcon(app)
|
2022-01-01 19:15:45 +08:00
|
|
|
|
app.component('draggable', Draggable)
|
|
|
|
|
app.component('svg-icon', SvgIcon)
|
|
|
|
|
|
|
|
|
|
components.forEach(component => {
|
|
|
|
|
app.component(component.name, component)
|
|
|
|
|
})
|
2022-02-23 10:40:44 +08:00
|
|
|
|
|
|
|
|
|
window.axios = axios
|
2022-01-01 19:15:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-01-29 19:49:51 +08:00
|
|
|
|
if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时赋值axios!! */
|
2022-02-23 10:40:44 +08:00
|
|
|
|
//window.axios = axios
|
2022-01-29 19:49:51 +08:00
|
|
|
|
}
|
2022-01-01 19:15:45 +08:00
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
install,
|
|
|
|
|
VFormDesigner,
|
|
|
|
|
VFormRender
|
|
|
|
|
}
|