Skip to content

Instantly share code, notes, and snippets.

@bjensen
Created January 30, 2019 16:29
Show Gist options
  • Save bjensen/74f98e72cc81ff427d584f4482647206 to your computer and use it in GitHub Desktop.
Save bjensen/74f98e72cc81ff427d584f4482647206 to your computer and use it in GitHub Desktop.
<template>
<v-text-field :label="name" v-on="listeners" :value="value" :error-messages="errors"/>
</template>
<script>
export default {
props: {
is_required: {
type: Boolean,
default: false
},
name: {
type: String,
default: "labelname"
},
type: {
type: String,
default: "text"
},
value: {
type: [String, Number],
default: ""
},
errors: {
type: Array,
default: function() {
return [];
}
}
},
computed: {
listeners() {
return {
...this.$listeners,
input: event => this.$emit("input", event.target.value)
};
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment