Skip to content

Instantly share code, notes, and snippets.

@jaydson
Created March 22, 2021 14:54
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/56fe3f3e1962ab72dcf8cb53935c5e09 to your computer and use it in GitHub Desktop.
Save jaydson/56fe3f3e1962ab72dcf8cb53935c5e09 to your computer and use it in GitHub Desktop.
<!-- CustomInput.vue -->
<template>
<label>
{{ label }}
<input type="text" :name="name" :value="value" @input="$emit('input', $event.target.value)" />
</label>
</template>
<script>
export default {
name: 'CustomInput',
props: {
label: {
type: String,
required: true,
},
value: {
type: String,
required: true,
},
},
computed: {
name() {
return this.label.toLowerCase();
},
},
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment