[Vuejs]-VUE emit from child to parent v-model

1👍

By emitting the event v-model listens to.

In Vue2, that’s input:

<input @change="updateSelectAllToateOptiunile(); sendListaToateOptiunile(), $emit('input', listaToateOptiunile)" v-model="listaToateOptiunile" :value="option" :id="option" type="checkbox" class="uk-checkbox">

In Vue 3, that’s update:modelValue:

<input @change="updateSelectAllToateOptiunile(); sendListaToateOptiunile(), $emit('update:modelValue', listaToateOptiunile)" v-model="listaToateOptiunile" :value="option" :id="option" type="checkbox" class="uk-checkbox">

Leave a comment