-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
急:Form 表单如何提交如何获取其中input的各字段的值 #122
Comments
同问,我本来以为可以通过ref来解决。发现ref获取的是Input组件~ 希望有结果了能通知一下 |
通过onChange事件。 |
我不想通过ref取值,难道weui没有取值的方法吗?还有我是想在最后提交的时候获取表单值,不是在输入的时候获取 |
用state存值 onchange更新 |
onchange state的实现模式还是比较好理解。我这里有一个问题,这样的实现方式会不会导致dom被频繁的刷新呢? react不是每一次state修改就有可能触发dom diff吗? |
@maigoxin react刷新是很频繁的 如果怕影响整体可以单独组件上用shouldComponentUpdate来判断是否需要更新dom |
有没有比较统一的解决方案类似于rc-form,集成rc-form,失败 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
<Form> <FormCell warn={isValidInput[0]} > <CellHeader> <Label>手机号</Label> </CellHeader> <CellBody> <Input type="tel" placeholder="输入手机号" /> </CellBody> <CellFooter > <Icon value="warn" /> </CellFooter> </FormCell> <FormCell> <Button onClick={this.handleSubmit}>登录绑定</Button> </FormCell> </Form>
这样提交表单在handleSubmit 中怎么获取输入的手机号?
The text was updated successfully, but these errors were encountered: