checkpoint

This commit is contained in:
2025-12-13 22:55:52 +01:00
parent 0d56d26afa
commit d81fb834c7
7 changed files with 187 additions and 20 deletions

View File

@@ -0,0 +1,32 @@
<script setup lang="ts">
import { ref } from 'vue'
const props = defineProps({
label: String,
placeholder: String,
inputError: String,
forceValidate: Boolean,
})
const inputText = defineModel('inputText')
const touched = ref(false)
</script>
<template>
<label class="label">{{ props.label }}</label>
<input
:class="[
'input w-full',
{ 'input-error': (touched || props.forceValidate) && props.inputError !== '' },
]"
:placeholder="props.placeholder"
v-model="inputText"
@blur="touched = true"
/>
<div
v-if="(touched || props.forceValidate) && props.inputError !== ''"
class="text-error text-sm mt-1"
>
{{ props.inputError }}
</div>
</template>