Is there a way to hide dynamically generated div elements in VueJS? In my chatbot application, messages are passed through a prop called messages
. These message arrays create multiple Divs on the screen displaying information. One particular Div is used to determine user satisfaction with the response. I want this specific response option box to disappear after the user selects "Yes" or "No". However, all my attempts so far make all of the response option boxes vanish together.
I have tried using the !isHidden property on the div and toggling it upon button click. But each time I do that, all response option boxes disappear without any new ones appearing.
Another approach I took was assigning a dynamic ID to target specific divs for hiding, just like I would in Vanilla JavaScript. Unfortunately, I am having trouble targeting individual Divs by their assigned IDs as the console returns null.
Can what I am attempting be achieved?
I have attached screenshots - one illustrating the UI and another containing the code (I have highlighted the portion of code I wish to hide for each message after it's clicked).
The last image showcases the exact divs I intend to hide, like hiding
messageResponseSatisfactionOption3
and messageResponseSatisfactionOption6
post-click. Apologies for blocking out major portions of the image; this is for a university project.
UI image showing element console
Thank you in advance :)