is reports really an array? open the console and check the error message
Sep 1, 2020
7
Level 40
@click event is not working in vue component
At first I thought this is going to be and easy thing to build/implement!
But then I hit a dead stop with @click="event_not_working".
Can you guys spot something that I am not doing correctly in code below?
<template>
<div class="an-side-panel" style="top: 90px; z-index: 2000;">
<div class="panel-tab">
<div class="tab-text">
Reports
</div>
</div>
<div class="p-3">
<div :key="report.id" class="d-flex align-items-center border-bottom" v-for="report in reports">
<div @click="download(report)" class="an-text-hover" title="Download">
{{ report.title }}
</div>
<div @click="email(report)" class="mx-2 ">
Email
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {reports: {}},
name: "ReportList",
data() {
return {
}
},
methods: {
email(report) {
console.log(report);
},
download(report) {
console.log('click received', report);
}
},
}
</script>
Both @click="email(report)" and @click="download(report)" events are not responding. Nothing gets console.log('working') in the console when I click on the text.
The reports I pass in as a prop. Component courtly renders that on the page, that tells me that parts of the component do work.
Any thought on what's could be happening?
Please or to participate in this conversation.