[Vuejs]-Two way data binding between parent and child

3👍

Assuming you use v2, the v-model="story is equivalent to two attributes: :value="story" and @input="story = $event". This means you have to use value instead of story as your prop name, as well as have your child component emit an input event with the new value as the parameter.

Vue 3 is slightly different, so check out the official documentation about the v-model property and the changes made to it since v2.

Leave a comment