Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<template>
<div>
<p> Wrapper for a text input </p>
<input
type="text"
placeholder="Custom input!"
@change='$emit("change", $event.target.value)'
/>
</div>
</template>
<script>
export default {
emits: ["change"]
}
</script>
<!-- then in the parent component, we can just listen to @change -->
<template>
<my-input @change="logChange"/>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment