I am creating a feature to hide and show description of image thumbnails (if user click the image thumbnail, the description will be shown animated). I already followed tutorial in VueJS about transition but unfortunately only one thumbnail works and the rest don't. I already removed the script during my try and errors. So, let take script of jquery as an example (pseudo code since I can't recall jquery syntax for now):
<div id="app">
<p> 1 </p>
<p> 2 </p>
</div>
jQuery("#app p").click(function(){
alert(p.text);
});
We only need that script and alert(p.text) has different value based on which <p> that user clicked and we dont need to write script for each <p>
How to do it in VueJS ? in nutshell I am confused how to apply one instance of VueJS with click event on it for many elements.