whale-form
v1.1.11
Published
render antd forms with json
Downloads
428
Maintainers
Readme
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}
/>