I am new to Vue & Vuetify and am trying to solve a problem where I display a table, with some data. I would like a delete icon in the last column so some action is taken when they click. However, I cannot get the icon to display when the items are displayed. I can get either the data to display (using template or default :items) OR I can get the icon to display and respond to the click. I cannot get data and an icon to show at the same time.
Here is my Codepen: https://codepen.io/sonoerin/pen/ZEaRjOW
Here is my code sample:
...
<v-data-table
:headers="fobHeaders"
:items="selected.scannedDevices"
:items-per-page="5"
class="elevation-1">
<template slot="items" slot-scope="props">
<tr>
<td>{{ props.item.deviceType }}</td>
<td>{{ props.item.role }}</td>
<td>{{ props.item.status }}</td>
<td>{{props.item.activationDate}}</td>
<td> <v-icon large @click="deleteFob(props.item)"> mdi-access-point-remove </v-icon></td>
</tr>
</template>
</v-data-table>
...
data() {
return {
fobHeaders: [
{ text: "Type", value: "deviceType", sortable: true },
{ text: "Role", value: "role", sortable: true },
{ text: "Status", value: "deviceStatus", sortable: true },
{ text: "Active Date", value: "activationDate", sortable: true },
{ text: "Action", value: "action", sortable: false }
],
...
}