In my form, I am encountering an issue with a textarea field when inserting a value from the database (using Laravel 10 and Inertia) where it is not being displayed. However, in other instances, the value appears as expected. It seems that there is a conflict within the v-model regarding this particular value.
<script setup>
...
let form = reactive({
header: '',
});
...
</script>
<template>
...
<textarea
v-model="form.header"
@input="onInputheader"
>{{ article.header }}</textarea>
...
</template>
Attempting to set a default value in the v-model like shown below also presents challenges:
<script>
data() {
return {
form.header: article.header,
}
The syntax used for form.header is incorrect, while the reference to article.header is not defined.
</script>.
let form = reactive({
header: article.header,
});
Moreover, article.header remains undefined.
I am seeking guidance on how to successfully pass the variable value to the textarea using the v-model attribute.