Registration completed

This commit is contained in:
2024-07-30 23:25:47 +02:00
parent f2600a3012
commit edf23bdbaa
12 changed files with 191 additions and 73 deletions

View File

@@ -6,12 +6,15 @@ interface Prop
}
const props = defineProps<Prop>();
const model = defineModel<string>();
const err = ref<string | boolean | undefined>(props.error);
</script>
<template>
<div class="input-group">
<label v-if="title" class="input-label">{{ title }}</label>
<input class="input-input" :class="{'input-has-error': !!error}" v-model="model" v-bind="$attrs" />
<span v-if="error && typeof error === 'string'" class="input-error">{{ error }}</span>
<input @input="err = false" class="input-input" :class="{ 'input-has-error': !!err }" v-model="model"
v-bind="$attrs" />
<span v-if="err && typeof err === 'string'" class="input-error">{{ err }}</span>
</div>
</template>