[Vuejs]-One-way binding for a textarea in vue js – safe to use `:value`?

4👍

Remember that v-model is basically the same as:

<textarea
   :value="something"
   @input="something = $event.target.value"
></textarea>

So when you do the :value instead of v-model you are only doing the one way binding and not getting the @input back out, thus you get the one-way binding instead of the two-way binding you get with v-model. If your goal is to get one-way binding, then this is certainly the way to do it.

Leave a comment