#Textarea v-model with an object does not work

8 messages · Page 1 of 1 (latest)

stiff hamlet
#

Hi guys,
I have this textarea
<textarea :v-model="editCase.ai_short_title!" />

Here is my variable inside the setup script
const editCase = ref<caseStudy | null>(null)

I am assigning a value to that variable on a button click
editCase.value = caseStudy

but the textarea appears empty and the value of editCase.ai_short_title does not change when I add some text inside.

What am I doing wrong? I expected the textarea do have the ai_short_title value inside, also, that value is not null, it has text inside it.

Thank you!

native mason
#

there should be no ":" before "v-model." just do v-model="…"

stiff hamlet
#

omg, how did I miss that 😄

#

thanks, that worked

#

it wasnt giving me any errors or warnings with the column at all

native mason
#

glad that fixed it! 😆

native mason
#

@stiff hamlet also, don't forget to mark this as "solved." thanks!

stiff hamlet
#

How do i do that @native mason ? 🙂