I need help transforming a div
into an input box when clicked, allowing me to edit the post inside a loop.
Here is the button found on the post:
<a @click="setFocusEdit(index)" v-if="isAuthor(post)" href="#" >Edit Me</a>
And here is the specific div
in question:
<div :ref="'p' + index" class="post-description">
{{post.description}}
</div>
This is the method I am using:
setFocusEdit(index) {
console.log('focusing on', index);
this.$refs['p' + index].focus();
},
However, I am encountering the following error message:
Uncaught TypeError: this.$refs[("p" + index)].focus is not a function
Could you provide guidance on resolving this issue?