Initial commit, framework/frontend assets setup

This commit is contained in:
Maarten 2024-11-25 18:59:11 +01:00
commit 9d9858bb37
32 changed files with 4651 additions and 0 deletions

View file

@ -0,0 +1,45 @@
<script setup lang="ts">
import { defineProps, defineEmits, ref, watch } from 'vue';
const props = defineProps( {
modelValue: {
type: String,
default: '',
},
name: {
type: String,
},
required: {
type: Boolean,
default: false,
},
placeholder: {
type: String,
default: "",
}
} );
const emit = defineEmits(['update:modelValue']);
const inputValue = ref(props.modelValue);
const updateValue = () => {
emit('update:modelValue', inputValue.value);
};
// If the modelValue prop changes externally, update the local ref
watch(() => props.modelValue, (newVal) => {
inputValue.value = newVal;
});
</script>
<template>
<input
type="text"
:id="name"
:name="name"
class="mt-1 p-2 w-full border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
:placeholder
:required
v-model="inputValue"
@input="updateValue"
>
</template>