@zgeaw/form-design
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

安装

npm install @zgeaw/form-design

NodeJs:

请自行导入ElementUI并挂载

import FormCreate from "@form-create/element-ui";
import FormDesign from "@zgeaw/form-design";

Vue.use(FormCreate);
Vue.use(FormDesign);

使用

<FormDesign ref="designer" :optionConfig="optionConfig" /> optionConfig = {
token: '', uploadApi: '' }

组件props

  • menuMenuList 重新配置拖拽的组件
  • heightint|string 设计器组件高度, 默认100%

组件方法

  • 获取当前生成表单的生成规则

    type getRule = () => Rule[];

    示例: this.$refs.designer.getRule()

  • 获取当前表单的全局配置

    type getOption = () => Object;
  • 设置当前生成表单的规则

    type setRule = (rules: Rule[]) => void;
  • 设置当前表单的全局配置

    type setOption = (option: Object) => void;
  • 增加一组拖拽组件

    type addMenu = (menu: Menu) => void;
  • 删除一组拖拽组件

    type removeMenu = (name: string) => void;
  • 批量覆盖插入拖拽组件

    type setMenuItem = (name: string, items: MenuItem[]) => void;
  • 插入一个拖拽组件到分组

    type appendMenuItem = (name: string, item: MenuItem) => void;
  • 删除一个拖拽组件

    type removeMenuItem = (item: string | MenuItem) => void;
  • 新增一个拖拽组件的生成规则

    type addComponent = (item: DragRule) => void;

Readme

Keywords

Package Sidebar

Install

npm i @zgeaw/form-design

Weekly Downloads

0

Version

1.0.9

License

MIT

Unpacked Size

4.41 MB

Total Files

53

Last publish

Collaborators

  • zgeaw