This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<p> Wrapper for a text input </p> | |
<input | |
type="text" | |
placeholder="Custom input!" | |
@change='customChange' | |
/> | |
</div> | |
</template> | |
<script> | |
export default { | |
setup (props, context) { | |
const customChange = (event) => { | |
context.emit("customChange", event.target.value) | |
} | |
return { | |
customChange | |
} | |
} | |
} | |
</script> | |
<!-- OR --> | |
<script> | |
export default { | |
setup (props, { emit }) { | |
const customChange = (event) => { | |
emit("customChange", event.target.value) | |
} | |
return { | |
customChange | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment