whale-form
TypeScript icon, indicating that this package has built-in type declarations

1.1.11 • Public • Published

whale-form

React render antd forms with json

Development

npm install

npm start

open http://localhost:8000/

Install

npm install antd whale-form --save

Usage

const source = [
  {
    type: 'input',
    name: 'input',
    label: '普通文本',
    placeholder: '请输入',
    rules: [{ required: true, whitespace: true, max: 10, message: '请检查输入的文本' }],
    value: 'input',
  },
]
const renderAction = () => (
  <Button type="primary" htmlType="submit">
    提交
  </Button>
);
const onSubmit = (v) => {
  console.log('onSubmit: ', v);
};

// render 
<WhaleForm
  formSource={source}
  renderAction={renderAction}
  onFinish={onSubmit}
/>

Package Sidebar

Install

npm i whale-form

Weekly Downloads

2

Version

1.1.11

License

MIT

Unpacked Size

367 kB

Total Files

170

Last publish

Collaborators

  • lich-yoo