Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alfred-skyblue/v-form-antd

基于ant-design-vue的可视化表单生成器
https://github.com/alfred-skyblue/v-form-antd

ant-design form typescript vue vue3

Last synced: 20 days ago
JSON representation

基于ant-design-vue的可视化表单生成器

Awesome Lists containing this project

README

        

# v-form-antd

[![MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/Alfred-Skyblue/v-form-antd)
[![github](https://img.shields.io/badge/Author-Alfred_Skyblue-blue.svg)](https://github.com/Alfred-Skyblue)
[![CompositionAPI](https://img.shields.io/badge/Composition-API-green.svg)](https://github.com/vuejs/composition-api)

![](https://photos-1301289647.cos.ap-shanghai.myqcloud.com/github/custom-cmp.gif)

## 简介
本项目参考自[k-form-design](https://github.com/Kchengz/k-form-design),支持自定义组件、表单联动等高级功能,使用 vue2 + CompositionAPI + ts 实现伪 vue3 应用

+ [表单设计器](https://yuan_fangy.gitee.io/v-form-design/)
+ [github](https://github.com/Alfred-Skyblue/v-form-antd)
+ [码云](https://gitee.com/yuan_fangY/v-form-antd)
+ [Document](https://alfred-skyblue.github.io/v-form-antd/)
+ [国内文档地址](https://yuan_fangy.gitee.io/v-form-antd/)

## 使用方法

1. 安装
```shell
yarn add v-form-antd
# or
npm install v-form-antd
```

2. 在vue中使用
```javascript
// main.js
import Vue from 'vue'
import VFormAntd from 'v-form-antd'
import 'v-form-antd/lib/index.css'

Vue.use(VFormAntd)
```

3. 使用表单设计器
```vue

```

4. 使用v-form-create渲染表单
```vue



提交

export default {
data () {
return {
fApi:{},
formData:{},
formConfig: {
formItems: [
{
type: 'input',
label: '姓名',
field: 'name',
span: 12,
props: {
type: 'text'
}
},
{
type: 'number',
label: '年龄',
field: 'age',
span: 12,
props: {}
}
],
config: {
layout: 'horizontal',
labelLayout: 'flex',
labelWidth: 100,
labelCol: {},
wrapperCol: {}
}
}
}
},
methods: {
async submit() {
const data = await this.fApi.submit()
console.log(data)
}
}
}

```