扫码关注官方订阅号
这样设置的话,用this.refs.email.value取不到输入框的值,要怎么设置ref呢?
闭关修行中......
不推荐通过ref获取Input的值,如果非要通过ref获取的话,可以改成这样this.refs.email.refs.input.value,推荐监听onChange来获取值,具体可以看我写的demo:http://codepen.io/anon/pen/mE...,官方也有相关issue:https://github.com/ant-design...,问问题之前可以自己先看看官方 issue
ref
Input
this.refs.email.refs.input.value
onChange
issue
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
不推荐通过
ref获取Input的值,如果非要通过ref获取的话,可以改成这样this.refs.email.refs.input.value,推荐监听onChange来获取值,具体可以看我写的demo:http://codepen.io/anon/pen/mE...,官方也有相关issue:https://github.com/ant-design...,问问题之前可以自己先看看官方issue