vue emit from click event code example
Example 1: how emit in input in vue
<input @change="$emit('modelInput' , inputValueModel)" >
Example 2: vue 3 emits
<template>
<div>
<p>{{ text }}</p>
<button v-on:click="$emit('accepted')">OK</button>
</div>
</template>
<script>
export default {
props: ['text'],
emits: ['accepted']
}
</script>