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

a-input组件控件不受控制,通过设置v-model:value绑定的值并使用input事件导致页面显示不正确(请注意切换输入法)https://codesandbox.io/p/devbox/f6q96d 链接 #8032

Open
1 task done
GuoOcean opened this issue Feb 7, 2025 · 4 comments

Comments

@GuoOcean
Copy link

GuoOcean commented Feb 7, 2025

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.6

Environment

vue 3.4.15

Reproduction link

Edit on CodeSandbox

Steps to reproduce

使用a-input组件并通过 v-model:value 进行绑定 再通过@input事件来限制输入的内容(如:限制a-输入只能输入数字不能输入字符串等等)

What is expected?

希望修改a-input组件dom元素在页面中展示问题
希望能看到并修复这个问题,再次特别感谢

What is actually happening?

a-input组件无法控制dom元素在页面中展示的数据

@GuoOcean GuoOcean changed the title a-input组件控件不受控制,通过设置v-model:value绑定的值并使用input事件导致页面显示不正确 a-input组件控件不受控制,通过设置v-model:value绑定的值并使用input事件导致页面显示不正确(请注意切换输入法) Feb 7, 2025
@huangmingfu
Copy link

huangmingfu commented Feb 7, 2025

啥意思?你的 codesandbox 打不开,这样吗?demo

你要限制的话,应该就不要用 v-model:value?这样子传 :value="input",在 @input 里重新赋值。

@GuoOcean GuoOcean changed the title a-input组件控件不受控制,通过设置v-model:value绑定的值并使用input事件导致页面显示不正确(请注意切换输入法) a-input组件控件不受控制,通过设置v-model:value绑定的值并使用input事件导致页面显示不正确(请注意切换输入法)https://codesandbox.io/p/devbox/f6q96d 链接 Feb 9, 2025
@GuoOcean
Copy link
Author

GuoOcean commented Feb 9, 2025

@huangmingfu
Copy link

不是有个input-number的组件吗?

@GuoOcean
Copy link
Author

不是有一个输入数字的组件吗?
那哥们你非要这样说我也不好说啥,但是问题确实是这样的[捂脸]

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

No branches or pull requests

2 participants