I'm trying to add a button to replace the words "View Details" within the table cell for every row. I've tried implementing a template and every time I save changes, the table returns no results which is telling me something is broken.
This is what the table currently looks like:
Here is my code:
<vue-good-table
:columns="columns"
:rows="rows"
:globalSearch="true"
:paginate="true"
:responsive="true"
:lineNumbers="false"
class="styled"
styleClass="table">
<template slot="table-row" slot-scope="props">
<span v-if="props.column.field == 'Details'">
<button type="button" class="btn btn-primary">
View Details
</button>
</span>
<span v-else>
{{props.formattedRow[props.column.field]}}
</span>
</template>
</vue-good-table>
. . . .
columns: [
{
label: "Date",
field: "date",
filterable: true
},
{
label: "Event",
field: "event",
filterable: true
},
{
label: "Details",
field: "details",
filterable: true
}
],
rows: [
{
event: "Thanksgiving Barrel Events",
details: "View Event",
date: "11/28/2018 at 6:34 PM"
},
{
event: "Christmas Barrel Events",
details: "View Event",
date: "12/25/2018 at 6:34 PM"
},