Skip to content

v-model.trim doesn't work #3816

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

Closed
1 task
HaLibrary opened this issue Mar 18, 2021 · 10 comments
Closed
1 task

v-model.trim doesn't work #3816

HaLibrary opened this issue Mar 18, 2021 · 10 comments
Labels

Comments

@HaLibrary
Copy link

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

Version

2.0.1

Environment

browser version:版本 89.0.4389.82(正式版本) (64 位)

Reproduction link

https://github.com/vueComponent/ant-design-vue

Steps to reproduce

无法自动过滤用户输入的首尾空白字符

What is expected?

自动过滤用户输入的首尾空白字符

What is actually happening?

无法自动过滤用户输入的首尾空白字符

@zkwolf zkwolf added the 🤔 Need Reproduce We cannot reproduce your problem label Mar 18, 2021
@github-actions
Copy link

Hello @HuanghaiTing. Please provide a online reproduction by forking this link for vue2link for vue3 or a minimal GitHub repository. Make sure to choose the correct version.

你好 @HuanghaiTing, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 for vue2此处 for vue3 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。请确保选择准确的版本。

@HaLibrary
Copy link
Author

@John60676
Copy link
Member

John60676 commented Mar 18, 2021

https://codesandbox.io/s/exciting-hamilton-3t34g?file=/src/components/HelloWorld.vue

绑定 v-model 不是 这样写 v-model.trim="number",而是要这样写 v-model:value.trim="number"

请仔细看文档: https://2x.antdv.com/components/input#API

@HaLibrary
Copy link
Author

大佬再问一个~for vue2 的写法是?
image

@John60676

@John60676
Copy link
Member

好像是有点问题,这个我还要再看一下

@John60676 John60676 reopened this Mar 18, 2021
@John60676 John60676 added 1.x version 1.x bug and removed 🤔 Need Reproduce We cannot reproduce your problem labels Mar 18, 2021
@John60676
Copy link
Member

好像是有点问题,这个我还要再看一下

可以改成如 原生一样吗 v-model="", v-model.trim 为什么一定要加一个 v-model:value, 这样感觉不理想
element ui 里的 el-input 组件,是支持 v-model 方式的,如 原生一样,希望能调整下

1.x 版本不用加 :value

@yinlei1126
Copy link

好像是有点问题,这个我还要再看一下

可以改成如 原生一样吗 v-model="", v-model.trim 为什么一定要加一个 v-model:value, 这样感觉不理想
element ui 里的 el-input 组件,是支持 v-model 方式的,如 原生一样,希望能调整下

1.x 版本不用加 :value

大佬:2.x 版本为什么要加这个呀

@yajore
Copy link

yajore commented Mar 26, 2021

好像是有点问题,这个我还要再看一下

可以改成如 原生一样吗 v-model="", v-model.trim 为什么一定要加一个 v-model:value, 这样感觉不理想
element ui 里的 el-input 组件,是支持 v-model 方式的,如 原生一样,希望能调整下

1.x 版本不用加 :value

大佬:2.x 版本为什么要加这个呀

2.x基于vue3的啊,这是vue3的变化导致的啊,先把vue3了解下

@John60676
Copy link
Member

下个版本修复

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants