How to pass QTable props to a method(a function) on @click
-
I am trying to access table prop on click using @click but its now working. Please give me suggestion. Thank you.
Here is sample code that i was trying.
<q-table
:data=“outcome”
title=“Customer Data”
:columns=“constant.columns”
row-key=“constant.name”
selection=“multiple”
:selected.sync=“selected”
:pagination.sync=“pagination”<template slot=“body” slot-scope=“props”>
<q-tr :props=“props”>
<q-td key=“actions” :props=“props” >
<q-btn size=“sm” :props=“props” outline color=“secondary” icon=“send” class=“q-mr-xs” @click=“playAudio(props.row.recordingUrl)” >
</q-btn>
</q-td>
</q-tr>
</template></q-table>
and the function under methods:
methods: {
playAudio: function(audioUrl){
console.log("Audio Url is : – ", audioUrl);
const audio = new Audio(‘audioUrl’);
audio.play();
}
}here i am trying to access audio URL and it says undefined in console
-
have you really read http://quasar-framework.org/components/datatable.html ? its all in there! please always check docs!