1.0.1 • Published 3 years ago

@huangxunlei/avue-form-design v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

简介

本项目是一款基于 Avue 的表单设计器,拖拽式操作让你快速构建一个表单。

基于sscfaith/avue-form-design 进行修改

:tada: 基于Bladex的工作流插件已上市。授权地址 表单设计器预览地址 流程设计器预览地址 工作流插件预览地址

更新日志

更新日志

文档及demo项目

Wiki

依赖

element-ui 2.13.2+

$ npm i element-ui

@smallwei/avue 2.6.16+

$ npm i @huangxunlei/avue

或自行引入cdn

安装

组件

$ npm i @huangxunlei/avue-form-design
或
$ yarn add @huangxunlei/avue-form-design

源码

github or gitee

$ yarn
$ yarn serve

html

详见examples

使用

import AvueFormDesign from '@huangxunlei/avue-form-design'

Vue.use(AvueFormDesign)
<avue-form-design style="height: 86vh;"
                  :options="options"
                  storage
                  @submit="handleSubmit"></avue-form-design>

属性

参数说明类型默认值
options字段配置Object/String{ column: [] }
storage开启本地存储功能,防止浏览器刷新丢失jsonBooleanfalse
asideLeftWidth左工具栏宽度String/Number'270px'
asideRightWidth右工具栏宽度String/Number'380px'
showAvueDoc(已废弃,请使用toolbar)是否显示Avue文档Booleanfalse
showGithubStar是否显示GitHub StarBooleantrue
toolbar顶部工具栏Array'avue-doc', 'import', 'generate', 'preview', 'clear'
undoRedo是否开启撤销重做功能Booleantrue
includeFields左侧展示字段ArrayfieldsConfig.js中配置的字段
customFields自定义组件Array使用方法

options字段配置

Avue文档

属性说明类型可选值默认值
columnAvue字段Array-[]
labelPosition字段位置String'left'/'center'/'right'-
labelWidth字段宽度Number--
gutter字段间隔Number-0
menuBtn表单按钮Booleantrue/falsetrue
submitBtn显示提交按钮Booleantrue/falsetrue
submitText提交按钮文本String-'提交'
emptyBtn显示清空按钮Booleantrue/falsetrue
emptyText清空按钮文本String-'清空'
tabs多分组转标签Booleantrue/falsefalse
detail详情模式Booleantrue/falsefalse
readonly全局只读Booleantrue/falsefalse
disabled全局禁用Booleantrue/falsefalse

事件

名称说明回调参数
submit生成json回调当前配置的json

方法

名称说明参数返回
getData获取当前编辑器的JSONtype: 'string'/'json'Promise

插槽

名称说明
toolbar顶部工具栏右侧插槽
toolbar-left顶部工具栏左侧插槽

Avue插件

富文本

import AvueUeditor from 'avue-plugin-ueditor'

Vue.use(AvueUeditor)

打包

组件

$ yarn lib

源码

$ yarn build

鸣谢

sscfaith/avue-form-design

Avue

License

MIT