zjx-react-form

2.1.9 • Public • Published

####安装

npm install zjx-react-form

####引入

import {Form,FormItem} from "zjx-react-form";

####使用

@Form.create()
class FormComponent extends Component {

    constructor(props) {
        super(props);
    }

    checkForm = () => {
        const  {form:{validateFields}} = this.props
        validateFields((err,values)=>{
            console.log(err,values)
        })
    };

    onNNoteChange = (e)=>{
        console.log(123)
    }

    render() {
        const {form: {getFieldDecorator}} = this.props;
        return <Fragment>
                <FormItem label={"note"}>
                    {getFieldDecorator("note", {
                        initValue: 1234 || "",
                        rules: [{
                            require: true,
                        }]
                    })(<input onChange={this.onNNoteChange}/>)}
                </FormItem>
                <FormItem label={"text"}>
                    {getFieldDecorator("text", {})(<input/>)}
                </FormItem>
            <button onClick={this.checkForm}>查看表单值</button>
        </Fragment>;
    }
}

####码云开源地址 https://gitee.com/onezilc/my-react-form.git

Readme

Keywords

none

Package Sidebar

Install

npm i zjx-react-form

Weekly Downloads

0

Version

2.1.9

License

ISC

Unpacked Size

209 kB

Total Files

10

Last publish

Collaborators

  • 1zilc