# form-create **Repository Path**: gitcrazy/form-create ## Basic Information - **Project Name**: form-create - **Description**: form-create 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的表单生成组件。支持3个UI框架,并且支持生成任何 Vue 组件。内置20种常用表单组件和自定义组件,再复杂的表单都可以轻松搞定。 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: 2.5 - **Homepage**: http://www.form-create.com/v2 - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 233 - **Created**: 2023-06-23 - **Last Updated**: 2023-06-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

# form-create [![MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/xaboy/form-create) [![github](https://img.shields.io/badge/Author-xaboy-blue.svg)](https://github.com/xaboy) [![document](https://img.shields.io/badge/Doc-welcome-red.svg)](http://www.form-create.com/v2/) **form-create 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的表单生成组件。支持3个UI框架,并且支持生成任何 Vue 组件。内置20种常用表单组件和自定义组件,再复杂的表单都可以轻松搞定。** **支持 vue3 版本** [开源的vue可视化表单设计器组件](https://github.com/xaboy/form-create-designer) ([功能演示](http://form-create.com/designer?fr=fc)) | [Vue3版本](https://github.com/xaboy/form-create/tree/next) ## 支持 - **iview** - **view-design** - **element-ui** - **ant-design-vue** > 如果对您有帮助,您可以点右上角 "Star" 支持一下 谢谢!本项目还在不断开发完善中,如有任何建议或问题[请在这里提出](https://github.com/xaboy/form-create/issues/new) > 本项目QQ讨论群[629709230](https://jq.qq.com/?_wv=1027&k=F1FlEFIV) > [更新日志](http://www.form-create.com/v2/guide/update.html) - **预览** ![demo1](https://raw.githubusercontent.com/xaboy/form-create/dev/images/demo-live3.gif)
更多 - **操作表单** [详细说明](http://www.form-create.com/v2/instance.html) ![demo2](https://raw.githubusercontent.com/xaboy/form-create/dev/images/demo-live2.gif) - **`group` 组件** [详细说明](http://www.form-create.com/v2/guide/group.html) ![demo3](https://raw.githubusercontent.com/xaboy/form-create/dev/images/demo-group.gif) - **`control` 配置项** [详细说明](http://www.form-create.com/v2/guide/control.html) ![demo2](https://raw.githubusercontent.com/xaboy/form-create/dev/images/demo-live4.gif)
## 文档 [简体中文](http://www.form-create.com/v2/) | [Vue3版本](http://www.form-create.com/v3/) | [English](http://www.form-create.com/en/v2/) ## 包说明 | 包名 | 说明 | | ------------------ | ---------------------------------------------------------- | | @form-create/iview [![version](https://img.shields.io/npm/v/@form-create/iview.svg)](https://www.npmjs.com/package/@form-create/iview) [![npm](https://img.shields.io/npm/dt/@form-create/iview.svg)](https://www.npmjs.com/package/@form-create/iview) | [iview 版本](http://form-create.com/v2/iview/) | | @form-create/iview4 [![version](https://img.shields.io/npm/v/@form-create/iview4.svg)](https://www.npmjs.com/package/@form-create/iview4) [![npm](https://img.shields.io/npm/dt/@form-create/iview4.svg)](https://www.npmjs.com/package/@form-create/iview4) | [view-design 版本](http://form-create.com/v2/iview/) | | @form-create/element-ui [![version](https://img.shields.io/npm/v/@form-create/element-ui.svg)](https://www.npmjs.com/package/@form-create/element-ui) [![npm](https://img.shields.io/npm/dt/@form-create/element-ui.svg)](https://www.npmjs.com/package/@form-create/element-ui) | [element-ui 版本](http://form-create.com/v2/element-ui/) | | @form-create/ant-design-vue [![version](https://img.shields.io/npm/v/@form-create/ant-design-vue.svg)](https://www.npmjs.com/package/@form-create/ant-design-vue) [![npm](https://img.shields.io/npm/dt/@form-create/ant-design-vue.svg)](https://www.npmjs.com/package/@form-create/ant-design-vue) | [ant-design-vue 版本](http://form-create.com/v2/ant-design-vue/) | | @form-create/designer [![version](https://img.shields.io/npm/v/@form-create/designer.svg)](https://www.npmjs.com/package/@form-create/designer) [![npm](https://img.shields.io/npm/dt/@form-create/designer.svg)](https://www.npmjs.com/package/@form-create/designer) | [表单设计器](http://form-create.com/designer) | ## 示例 - [使用生成器生成](https://jsrun.net/NQhKp/edit) - [使用 json 生成](https://jsrun.net/NQhKp/edit) - [各种示例](http://www.form-create.com/v2/guide/demo.html)
图例 ![https://raw.githubusercontent.com/xaboy/form-create/dev/images/sample110.jpg](https://raw.githubusercontent.com/xaboy/form-create/dev/images/sample110.jpg)
## 安装 > 根据自己使用的 UI 安装对应的版本 iview ```shell npm install @form-create/iview ``` view-design ```shell npm install @form-create/iview4 ``` element-ui ```shell npm install @form-create/element-ui ``` ant-design-vue ```shell npm install @form-create/ant-design-vue ``` ## 引入 **CDN:** iview ```html ``` element-ui ```html ``` ant-design-vue ```html ``` **NodeJs:** iview ```js import formCreate from '@form-create/iview' Vue.use(formCreate) ``` element-ui ```js import formCreate from '@form-create/element-ui' Vue.use(formCreate) ``` ant-design-vue ```js import formCreate from '@form-create/ant-design-vue' Vue.use(formCreate) ``` ## 使用 ```html ``` ```javascript export default { data(){ return { fApi:{}, value:{field1:'111',field2:'222',time:'11:11:11'}, options:{ onSubmit:(formData)=>{ alert(JSON.stringify(formData)) } }, rule:[ {type:'input', field:'field1',title:'field1',value:'aaa'}, {type:'input', field:'field2',title:'field2',value:'sss'}, {type:'timePicker', field:'time',title:'time',value:'12:12:12'}, { type:'ElButton', title:'修改 field1', native: false, on:{ click: ()=>{ this.rule[0].value+='a' } }, children: ['点击'], } ] } } } ``` ## 源码运行 下载项目 ```sh $ git clone https://github.com/xaboy/form-create.git $ cd form-create ``` 安装依赖 ```sh $ npm install -g rimraf $ npm run bootstrap ``` 查看 iview 示例 ```sh $ npm run dev:iview ``` 查看 view-design 示例 ```sh $ npm run dev:iview4 ``` 查看 element-ui 示例 ```sh $ npm run dev:ele ``` 查看 ant-design-vue 示例 ```sh $ npm run dev:antd ``` ## 感谢 [时光弧线](https://github.com/shiguanghuxian) | [wxxtqk](https://github.com/wxxtqk) | [williamBoss](https://github.com/williamBoss) | [HeyMrLin](https://github.com/HeyMrLin) | [djkloop](https://github.com/djkloop) | [JetBrains](https://www.jetbrains.com/?from=form-create) ## 捐赠 ![donation.jpg](http://form-create.com/img/donation.jpg) ## 联系 ##### email : xaboy2005@qq.com ## License [MIT](http://opensource.org/licenses/MIT) Copyright (c) 2018-present xaboy