Vue.js - How do I get data from div blocks using the click handler?

Viewed 84

I have a Vue component. By clicking on it, you need to get information from all the fields in order to work with it in the future. How can I implement this?

<template>
    <div class = "row__elements">
       <div @click="event =>clickOnRow(event)" class = "row__element">
           <div class = "file-info"> </div>
           <div class = "file-info title"> {{elem.fileName}} </div>
           <div class = "file-info size"> {{elem.sizeOrType}} </div>
           <div class = "file-info date"> {{elem.dateOfChange}} </div>
        </div>   
    </div>
</template>
1 Answers

You could pass the event and any additional parameter to the event handler :

<div @click="clickOnRow($event,elem)" class = "row__element">
Related