17 lines
510 B
Vue
17 lines
510 B
Vue
<script setup lang="ts">
|
|
interface Prop
|
|
{
|
|
error?: string | boolean;
|
|
title: string;
|
|
}
|
|
const props = defineProps<Prop>();
|
|
const model = defineModel<string>();
|
|
</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>
|
|
</div>
|
|
</template> |