|
|
7 years ago | |
|---|---|---|
| .github | 7 years ago | |
| docs | 7 years ago | |
| packages | 7 years ago | |
| scripts | 7 years ago | |
| .all-contributorsrc | 7 years ago | |
| .babelrc | 7 years ago | |
| .editorconfig | 7 years ago | |
| .eslintignore | 7 years ago | |
| .eslintrc | 7 years ago | |
| .gitignore | 7 years ago | |
| .npmrc | 7 years ago | |
| .travis.yml | 7 years ago | |
| LICENSE.md | 7 years ago | |
| README.md | 7 years ago | |
| babel.config.js | 7 years ago | |
| jest.config.js | 7 years ago | |
| lerna.json | 7 years ago | |
| package.json | 7 years ago |
面向复杂场景的中后台表单解决方案
UForm 谐音 Your Form , 代表,这才是你想要的 Form 解决方案
🚧 文档&单测持续完善中,目前暂时不能投入生产环境使用!
🏅 副作用逻辑独立管理,涵盖各种复杂联动校验逻辑
🌯 支持各种表单复杂布局方案
npm install --save @uform/antd
或者
npm install --save @uform/next
import React from 'react'
import SchemaForm, { Field, FormButtonGroup, Submit, Reset } from '@uform/next'
import '@alifd/next/dist/next.css'
export default () => (
<SchemaForm
defaultValue={{ aa: '123' }}
onSubmit={values => console.log(values)}
>
<Field
type="string"
enum={['1', '2', '3', '4']}
required
title="Radio"
x-component="radio"
name="radio"
/>
<Field
type="string"
enum={['1', '2', '3', '4']}
required
title="Select"
name="select"
/>
<Field
type="string"
enum={['1', '2', '3', '4']}
required
x-component="checkbox"
title="Checkbox"
name="checkbox"
/>
<Field type="number" title="数字选择" name="number" />
<Field type="boolean" title="开关选择" name="boolean" />
<Field type="date" title="日期选择" name="date" />
<Field type="daterange" title="日期范围" name="daterange" />
<Field type="year" title="年份" name="year" />
<Field type="time" title="时间" name="time" />
<Field
type="array"
title="卡片上传文件"
name="upload"
x-component="upload"
x-props={{ listType: 'card' }}
/>
<Field
type="array"
title="拖拽上传文件"
name="upload2"
x-component="upload"
x-props={{ listType: 'dragger' }}
/>
<Field
type="array"
title="普通上传文件"
name="upload3"
x-component="upload"
x-props={{ listType: 'text' }}
/>
<Field
type="number"
title="范围选择"
name="range"
x-component="range"
x-props={{ min: 0, max: 1024, marks: [0, 1024] }}
/>
<Field type="array" x-component="transfer" title="穿梭框" name="transfer" />
<Field type="number" x-component="rating" title="等级" name="rating" />
<FormButtonGroup offset={7}>
<Submit />
<Reset />
</FormButtonGroup>
</SchemaForm>
)
UForm is open source software licensed as MIT.
Thanks goes to these wonderful people (emoji key):
Janry 🎨 |
SkyCai 🎨 |
|---|
This project follows the all-contributors specification. Contributions of any kind welcome!