We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
微信小程序
https://github.com/conan51551/taro-demo
小程序基础库: 3.2.5 使用框架: React
function InputNumber(props) { const { num, change } = props; console.log(num, "num"); const handleBlur = (e) => { const value = Number(e.detail.value); if (value >= 5) { change(5); } else { change(value); } }; return ( <View> <Input type="number" onBlur={handleBlur} value={props.num} key={props.num} /> </View> ); } export default InputNumber;
<InputNumber num={this.state.num} change={this.changeNum} />
同样这样使用InputNumber组件,在如果是用hook定义的function component 情况下,只有第一次当输入的数字大于5才能被改成5
InputNumber
当输入大于5的数字,数字每次都被改成5
在class componet中可以,但是在hook的function component中,只有第一次被修改成了5
The text was updated successfully, but these errors were encountered:
您的 Issue 没有按照规范从 Taro Issue Helper 创建,因此会被直接关闭。
维护开源项目是一项非常辛苦的工作,还请多多包涵。 了解为什么这么严格?
Sorry, something went wrong.
No branches or pull requests
相关平台
微信小程序
复现仓库
https://github.com/conan51551/taro-demo
小程序基础库: 3.2.5
使用框架: React
同样这样使用
InputNumber
组件,在如果是用hook定义的function component 情况下,只有第一次当输入的数字大于5才能被改成5期望结果
当输入大于5的数字,数字每次都被改成5
实际情况
在class componet中可以,但是在hook的function component中,只有第一次被修改成了5
The text was updated successfully, but these errors were encountered: