Skip to content
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

内置input组件有bug #4891

Open
github-ZH-cn opened this issue May 9, 2024 · 1 comment
Open

内置input组件有bug #4891

github-ZH-cn opened this issue May 9, 2024 · 1 comment

Comments

@github-ZH-cn
Copy link

image
image
已经把非数字的给替换为空了,非数字的还是显示了

@Li13
Copy link

Li13 commented May 23, 2024

uni-app input组件内部的value是用watch监听的,然后在watch监听回调把你传入的value赋给一个新的value
你本来是value title = 1
然后输入 1a
你把非数字删除value title = 1
然后title 没变!所以input 内部的 watch就不会触发
所以建议你这种:伪代码
this.title = 1a
$nextTick(() => {
this.title = 1
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants