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
Modifier .trim
: Incompatible trim()
when emit arg is not string
#6711
Comments
trim()
when emit arg is not string v-model.trim
: Incompatible trim()
when emit arg is not string
I think you should change $emit('update:modelValue', $event.target.value, {}) to $emit('update:modelValue', $event.target.value), because in this scenario the third parameter is completely redundant. A warning should be triggered when the user sets a redundant parameter, while the redundant parameter can simply be ignored. |
v-model.trim
: Incompatible trim()
when emit arg is not string .trim
: Incompatible trim()
when emit arg is not string
Thanks. Yes, it is redundant in here, but what I really want to express is: If the parameter type is not string, an error will directly cause the program to crash. so in my opinion, it should take into account the situation where the user uses modifiers I think there are two ways:
|
@zhangpaopao0609 duplicate #5765 |
Duplicate of #5765 |
Vue version
3.2.39
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-qujitj?file=src/App.vue
Steps to reproduce
What is expected?
trim()
, print a warning on the consoleWhat is actually happening?
Uncaught TypeError: a.trim is not a function
System Info
No response
Any additional comments?
trim
modifier implementationThe text was updated successfully, but these errors were encountered: