Skip to content

Instantly share code, notes, and snippets.

@ravipatel2293
Created July 21, 2020 10:11
Show Gist options
  • Save ravipatel2293/4dcaedcfd9eca148ff4b5886fb5f9f2c to your computer and use it in GitHub Desktop.
Save ravipatel2293/4dcaedcfd9eca148ff4b5886fb5f9f2c to your computer and use it in GitHub Desktop.
<template>
<input type="text" :value="hiddenValue" :ref="'inputRef'" @input="handleInput($event)">
</template>
<script>
export default {
name: "Input",
model: {
prop: "hiddenValue",
event: "blur"
},
props: {
hiddenValue: {
type: [String, Number]
}
},
methods: {
handleInput(event) {
const vm = this;
vm.$emit("blur", event.target.value);
}
}
};
</script>
<style scoped>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment