Skip to content

Instantly share code, notes, and snippets.

@jaydson
Created March 22, 2021 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaydson/ac2e010a291f32eb454a49e8b83ad71b to your computer and use it in GitHub Desktop.
Save jaydson/ac2e010a291f32eb454a49e8b83ad71b to your computer and use it in GitHub Desktop.
<!-- CustomInput.vue -->
<template>
...
<input type="text" :name="name" v-model="model" />
...
</template>
<script>
...
computed: {
...
model: {
get() {
return this.value;
},
set(value) {
this.$emit('input', value);
},
},
},
...
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment