library/frontend/components/Form/FormInput.vue

39 lines
773 B
Vue
Raw Normal View History

2023-05-23 10:48:57 -07:00
<script setup lang="ts">
2023-07-13 14:32:56 -07:00
defineProps<{label?: string, name:string, type?: string, modelValue?: any}>()
2023-05-23 10:48:57 -07:00
defineEmits(['update:modelValue'])
</script>
2023-07-13 14:19:39 -07:00
<!--------------------------------------------------------------- TEMPLATE ---->
2023-05-23 10:48:57 -07:00
<template>
<div>
<label v-if="label" :for="name">{{ label }}</label>
<input
:id="name"
:type="type ?? 'text'"
:value="modelValue"
:name="name"
v-bind="$attrs"
@input="$emit('update:modelValue', $event.target.value)"
>
</div>
</template>
2023-07-13 14:19:39 -07:00
<!------------------------------------------------------------------ STYLE ---->
2023-05-23 10:48:57 -07:00
<style scoped lang="postcss">
div {
@apply mb-4 last:mb-0;
}
label {
@apply block;
}
input {
@apply bg-white bg-opacity-30;
@apply border-gradient;
}
</style>