1 Star 18 Fork 5

李树涛/页面拖拽组件

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
install.js 2.36 KB
一键复制 编辑 原始数据 按行查看 历史
list 提交于 2022-11-07 20:11 . 表格组件、表单组件设计重构
import axios from 'axios'
import VFormDesigner from '@/components/form-designer/index.vue'
import VFormRender from '@/components/form-render/index.vue'
import VTableDesigner from '@/components/table-designer/index.vue'
import VPageDesigner from '@/components/page-designer/index.vue'
import Draggable from '@/../lib/vuedraggable/dist/vuedraggable.umd.js'
import {registerIcon} from '@/utils/el-icons'
import 'virtual:svg-icons-register'
import '@/iconfont/iconfont.css'
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)
registerIcon(app)
app.component('draggable', Draggable)
app.component(VFormDesigner.name, VFormDesigner)
}
VTableDesigner.install = function (app) {
addDirective(app)
installI18n(app)
loadExtension(app)
app.use(ContainerWidgets)
app.use(ContainerItems)
registerIcon(app)
app.component('draggable', Draggable)
app.component(VTableDesigner.name, VTableDesigner)
}
VPageDesigner.install = function (app) {
addDirective(app)
installI18n(app)
loadExtension(app)
app.use(ContainerWidgets)
app.use(ContainerItems)
registerIcon(app)
app.component('draggable', Draggable)
app.component(VPageDesigner.name, VPageDesigner)
}
VFormRender.install = function (app) {
installI18n(app)
loadExtension(app)
app.use(ContainerItems)
registerIcon(app)
app.component(VFormRender.name, VFormRender)
}
const components = [
VFormDesigner,
VFormRender,
VTableDesigner,
VPageDesigner
]
const install = (app) => {
addDirective(app)
installI18n(app)
loadExtension(app)
app.use(ContainerWidgets)
app.use(ContainerItems)
registerIcon(app)
app.component('draggable', Draggable)
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,
VFormDesigner,
VFormRender,
VTableDesigner,
VPageDesigner
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/phone_13699120238/variant-form3-pro.git
git@gitee.com:phone_13699120238/variant-form3-pro.git
phone_13699120238
variant-form3-pro
页面拖拽组件
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385