1👍
✅
You cannot use v-model
on a <div>
because it isn’t an input element.
It seems what you want to do is set text
to the comment message when you click the edit button so that it can be edited by the textarea. All you have to do is pass comment.message
as the argument:
<button @click="update(comment.message)">
A couple of other things:
- You cannot have multiple root elements in your template (you have two root
<div>
elements). You can just wrap everything in a single<div>
. text
has initial value[]
which isn’t compatible with a textarea’sv-model
; did you mean''
?
Source:stackexchange.com