How can the data associated with a row be obtained from a table with the @row-click event?
In the following example, how do I get the id and the name values of the clicked row?
<q-table
title="Treats"
dense
:data="data"
:columns="columns"
row-key="id"
@row-click="rowclick(evt, row)"
/>
(...)
methods: {
rowclick(evt, row){
alert()
}
},
Try this @row-click="onRowClick"
.
<q-table
title="Treats"
dense
:data="data"
:columns="columns"
row-key="id"
@row-click="onRowClick"
/>
methods: {
onRowClick (evt, row) {
console.log('clicked on', row)
}
},