[Vuejs]-Vue 3 emit as v-model

0👍

from https://www.digitalocean.com/community/tutorials/vuejs-add-v-model-support:

To understand how to implement v-model support in your components, you need to understand how it works under the hood. The v-model="prop" value is shorthand for :value="prop" @input="prop = arguments[0]".

v-model listens to ‘input’ emit event to fire,

Try using:
this.$emit('input', data);
in your component.

Leave a comment