og-image/src/ui/InputForm.vue
2023-02-24 21:40:50 +01:00

40 lines
842 B
Vue

<template>
<label class="block text-sm font-medium text-gray-700" :for="id" v-if="label" v-text="label"></label>
<input
class="mt-2 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
:type="type"
:id="id"
:value="modelValue"
:class="class"
@change="$emit('change', $event)"
@input="$emit('update:modelValue', $event.target.value)"
/>
</template>
<script>
export default {
props: {
modelValue: {
},
label: {
type: String,
required: false,
},
type: {
type: String,
required: false,
default: 'text'
},
id: {
type: String,
required: true,
},
"class": {
type: String,
required: false,
},
},
emits: ['update:modelValue'],
}
</script>