-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
calling methods is not allowed in v-model #3993
Comments
some improvements were made in (bc100c5 )
if your function does not have dynamic arguments, you can wrap the function in a computed what = computed( ()=> whatever()) <input v-model="what.ever"> if you do have dynamic arguments, it will complicate things to work around that limitation. |
Yeah, but if it has and they come from |
and here is a possible workaround if you really need dynamic arguments https://sfc-vue3.netlify.app/#/gist/c1242a00f99d8a3ed26cb002303dfcca I originally recommended reducing that to a development warning and not an error. |
Using the return value of a function in v-model used to work in vue 2. |
Same problem here:
`export default { props: { |
Version
3.1.2
Reproduction link
Vue 3 - not working:
sfc.vuejs.org
Vue 2 - working:
https://codepen.io/jkarczm/pen/ZEeNNPW?editors=1010
Steps to reproduce
<input v-model="whatever().something">
What is expected?
No compilation error
What is actually happening?
v-model value must be a valid JavaScript member expression.
The text was updated successfully, but these errors were encountered: