Giter Club home page Giter Club logo

form-demo's Introduction

form-demo

已更新,git pull以后,执行npm install一下然后npm start

  • components/FormField/组件目录
  • components/FormField/fieldMap.jsx // 新增组件维护一下组件映射 type -> FieldComponent 的 map
  • components/FormField/ExampleFieldComponent.jsx // field样本组件, 提供公共方法getValue 和 validate

数据说明(目前支持)


控件类型- "type":

  • number,
  • text,
  • textarea,
  • date

控件规则(form validation)- "specification":

  • {

  • required: BOOLEAN,

  • id_card: BOOLEAN, // 身份证号码

  • username: BOOLEAN, // 用户名规则

  • password: BOOLEAN, // 密码规则

  • email: BOOLEAN, // 邮箱

  • email_suffix: BOOLEAN, // 邮箱后缀

  • positive_number: BOOLEAN, // 正数

  • int: BOOLEAN, // 整数

  • currency: BOOLEAN, // 货币格式

  • min: NUMBER, // 最小值

  • max: NUMBER, // 最大值

  • max_not_equate: NUMBER, // 最大值并且不等于

  • min_length: NUMBER, // 最小长度

  • max_length: NUMBER, // 最大长度

  • length: NUMBER, // 长度匹配

  • }

form-demo's People

Watchers

Joyer.Z avatar  avatar

Forkers

jiangwanwei

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.