This plugin is built to be as versatile as possible, and allow you to inject your own HTML rendering using several slots.
See the Datatable API doc
footer
slotThis footer is displayed at the bottom of your data table.
Prop | Type | Description |
---|---|---|
rows |
TRow[] |
The list of rows currently displayed by the table. It only contains the current page. |
columns |
Column[] |
The columns of the table |
pagination |
IPageRange |
An object describing the current pagination status |
<datatable>
<template name="footer" scope="{ rows, columns, pagination }">
<tr>
<td :colspan="columns.length">Showing rows {{pagination.from}} to {{pagination.to}} of {{pagination.of}} items.</td>
</tr>
</template>
</datatable>
default
slotThis slot is used to render each rows. It completely overrides the default row rendering process.
Prop | Type | Description |
---|---|---|
row |
TRow |
The current row that it is appending to the table. |
index |
number |
The current index of the row in the displayed page. |
columns |
Column[] |
The columns of the table |
<datatable>
<template scope="{ row, columns }">
<tr>
<td>{{ row.id }}</td>
<td>{{ row.user.email }}</td>
<td>{{ row.address + ', ' + row.city + ', ' + row.state }}</td>
</tr>
</template>
</datatable>
no-results
slotThis slot is displayed if the table do not contain any rows.
Prop | Type | Description |
---|
<datatable>
<template name="no-result">
Nothing to see here
</template>
</datatable>
Generated using TypeDoc