You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After discovering this as an alternative for the deprecated Vue3 Reactivity Transforms, I had a read through the docs and saw this really cool defineModel macro, which could vastly simplify passing around some reactive state.
However, the version mentioned here does not allow me to use the resulting variable as a v-model in the template, because there it only counts as a non-writable prop, resulting in the following error:
"[plugin:vite:vue] v-model cannot be used on a prop, because local prop bindings are not writable.
Use a v-bind binding combined with a v-on listener that emits update:x event instead."
This is less of a bug and more a natural result of how the feature is implemented, however the way it limits its use is certainly unintended. I invite further discussion in the matter and apologize if my issue has been poorly expressed, since it has been a while since I've used Vue at all.
Btw, the output of envinfo seems to be wrong - Firefox (110.0) is my main browser after all.
Describe the bug
After discovering this as an alternative for the deprecated Vue3 Reactivity Transforms, I had a read through the docs and saw this really cool defineModel macro, which could vastly simplify passing around some reactive state.
However, the version mentioned here does not allow me to use the resulting variable as a v-model in the template, because there it only counts as a non-writable prop, resulting in the following error:
"[plugin:vite:vue] v-model cannot be used on a prop, because local prop bindings are not writable.
Use a v-bind binding combined with a v-on listener that emits update:x event instead."
This is less of a bug and more a natural result of how the feature is implemented, however the way it limits its use is certainly unintended. I invite further discussion in the matter and apologize if my issue has been poorly expressed, since it has been a while since I've used Vue at all.
Btw, the output of envinfo seems to be wrong - Firefox (110.0) is my main browser after all.
Reproduction
https://github.com/adroslice/vue-macros-definemodel-repro/tree/main/client
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: