No Description

Janry 86260a7e06 Merge pull request #7 from cnt1992/add-senior-config 7 years ago
.github 6c7239aeb6 refactor(project): 🚗 7 years ago
docs 4b7aacb930 chore: merge 7 years ago
packages 4b7aacb930 chore: merge 7 years ago
scripts 0890e6d640 refactor(docs): update docs 7 years ago
.all-contributorsrc d4f8ee9314 docs: update .all-contributorsrc 7 years ago
.babelrc ed015137a1 v0.1.0-alpha.12 7 years ago
.editorconfig b46b496256 refactor(project): first commit 7 years ago
.eslintignore b46b496256 refactor(project): first commit 7 years ago
.eslintrc 68fd2e1c92 test(project): add large test cases 7 years ago
.gitignore 7b83165748 fix(@uform/utils): fix bug of clone regexp 7 years ago
.npmrc b46b496256 refactor(project): first commit 7 years ago
.travis.yml 8a8057e39d refactor(project): update .travis.yml 7 years ago
LICENSE.md 1968d1f3ea refactor(project): LESENCE.md ==> LICENSE.md 7 years ago
README.md 48ec04413b feat(@uform/react): support common ArrayField Component 7 years ago
babel.config.js e8a902132a refactor(project): add test scripts 7 years ago
jest.config.js ed015137a1 v0.1.0-alpha.12 7 years ago
lerna.json 7792b13c16 v0.1.0-beta.14 7 years ago
package.json db6a668eac refactor(docs): update docs 7 years ago

README.md


面向复杂场景的中后台表单解决方案

UForm 谐音 Your Form , 代表,这才是你想要的 Form 解决方案

🚧 文档&单测持续完善中,目前暂时不能投入生产环境使用!

特性

  • 🚀 高性能,表单字段按需渲染,大大减轻 React 渲染压力
  • 🧩 支持 Ant Design/Fusion Next 组件体系
  • 🎨 JSX 标签化写法/JSON Schema 数据驱动方案无缝迁移过渡
  • 🏅 副作用逻辑独立管理,涵盖各种复杂联动校验逻辑

  • 🌯 支持各种表单复杂布局方案

安装

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>
)

LICENSE

UForm is open source software licensed as MIT.

Contributors

Thanks goes to these wonderful people (emoji key):

Janry
Janry

🎨
SkyCai
SkyCai

🎨

This project follows the all-contributors specification. Contributions of any kind welcome!