Skip to content
Snippets Groups Projects

Feat/login

Merged Jens Christian Aanestad requested to merge feat/Login into main
7 files
+ 193
26
Compare changes
  • Side-by-side
  • Inline
Files
7
<script setup lang="ts">
<script setup lang="ts">
 
const emit = defineEmits(['inputChangeEvent']);
const props = defineProps({
const props = defineProps({
label: {
label: {
type: String,
type: String,
@@ -16,19 +17,33 @@ const props = defineProps({
@@ -16,19 +17,33 @@ const props = defineProps({
inputId: {
inputId: {
type: String,
type: String,
required: true
required: true
 
},
 
modelValue: {
 
type: String,
 
default: ""
 
},
 
isValid: {
 
type: Boolean,
 
default: false
}
}
});
});
 
 
const onInputEvent = (event: any) => {
 
emit('inputChangeEvent', event.target.value)
 
}
</script>
</script>
<template>
<template>
<div>
<div>
<label :for="inputId">{{ label }}</label>
<label :for="inputId">{{ label }}</label>
<input :type="props.type"
<input :value="props.modelValue"
 
@input="onInputEvent"
 
:type="props.type"
class="form-control"
class="form-control"
:placeholder="props.placeholder"
:placeholder="props.placeholder"
:id="inputId" required />
:id="inputId" required />
<div class="invalid-feedback">Invalid {{ label }}</div>
<div v-if="props.isValid" class="invalid-feedback">Invalid {{ label }}</div>
<div class="valid-feedback">Correct {{ label }}</div>
<div v-else class="valid-feedback">Valid {{ label }}</div>
</div>
</div>
</template>
</template>
Loading