首页 > 编程知识 正文

react 如何触发表单的校验,react怎么给表单赋初始值

时间:2023-05-03 10:04:36 阅读:255723 作者:3895

ref={self => this.form = self}this.form.onsubmit()这样为什么报this.form.onsubmit is not a functioncomponentWillReceiveProps(nextProps) {if ('click' in nextProps.receive) {if (nextProps.receive.click) {this.form.submit();}}}render (ref={self => this.form = self}onSubmit={() => this.handleSubmit(event)}>input...)Header组件} />

transfer={data => this.transferSearch(data)}receive={this.state.receiveSearch}request={{method: 'POST',source: 'http://xxx:8080/bridge/prod_search',key: ['prod_name', 'start', 'end']}}/> this.transferHeaderRight(data)} />简单说就是搜索按钮在form外面怎么触发onSubmit或者handleSubmit()

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。