-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
v-model should generate ref assignment code for setup-reactive-const bindings #7429
Comments
this commit is a fix for #6241, and it's the correct, intended behavior. as @sxzz correctly says: to reassign a "variable" with v-model, use a ref. |
the primitive value here is just a example see this => |
thanks |
Again: for that, we need to use a |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Vue version
3.2.45
Link to minimal reproduction
https://sfc.vuejs.org/#eNp9kM1OwzAQhF9ltZeC1NgqP5eQovIevoRkoYH6R/YmPUR5d9YJlUKR6tvOrOcb7YhvIaihJyzRuIrJhlPN9GocyKs6F3qGobC+pdPe4Pko5kDRIGjZqfTqg4ypiV1gSMR9mCMMdzb4yDBGqhvuBprgI3oLG0FuFkjjXWK4JMMeLqt3u939S4YssTMCcItLZGHroL6Sd9J8nFm/RjJYwqxkTTh5NnhkDqnUunfh+1M13uqDeDr2TjpS0Xp7eFQP6ulZt13ita4o2eI9+nOiKESD21W4FlFqF5FcSzFf5gbsavcP8Mr7B83MybgJpx8a4pa2
Steps to reproduce
type something
What is expected?
no error
What is actually happening?
Assignment to constant variable.
System Info
No response
Any additional comments?
in version 3.2.44, v-model generate ref assignment code for setup-reactive-const bindings, this commit changed it
I think generating ref assignment code for setup-reactive-const bindings is right, just like
const a = ref(1)
("a": "setup-ref"), and it maybe an object in reactive likeconst whatever = reactive([]);
so v-model should generate ref assignment code for setup-reactive-const bindings
The text was updated successfully, but these errors were encountered: