Skip to content

Instantly share code, notes, and snippets.

@davidroyer
Created November 17, 2021 23:33
Show Gist options
  • Save davidroyer/dd92f8202966465368234be0937cdc11 to your computer and use it in GitHub Desktop.
Save davidroyer/dd92f8202966465368234be0937cdc11 to your computer and use it in GitHub Desktop.
<template>
<div>
<label class="font-semibold block text-gray-700" for="input"
>Base Input</label
>
<input
type="text"
:value="modelValue"
@input="$emit('update:modelValue', $event.target.value)"
/>
<!-- <input type="text" :value="modelValue" @input="handleInput" /> -->
</div>
</template>
<script>
export default {
props: {
modelValue: {
type: [String, Number],
default: ''
}
},
emits: ['update:modelValue'],
methods: {
handleInput($event) {
this.$emit('update:modelValue', $event.target.value)
}
}
}
</script>
<style></style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment