Recently on a vue telegram group, I’ve asked how to use computed data with v-model. A member has said me that its’n not a good practice using it this way. So, I’d like to ask you why it’s not a good practice or not secure to use computed data with v-model?
v-model creates a two-way binding between the element and the property, while a computed property only creates a one-way relationship between the source data and the computed property (unless you use
get(), but this can easily get messy).
Why not, if you understand what you do. For example, it could be used to make a shortcut reference to deeply nested data object, by this approach you can decouple the template from the data structure.
There is also vuex example