1.0.4 • Published 2 years ago

feathers-data-table v1.0.4

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

Feathers DataTable

Vuetify 2 data table that implements FeathersJS pagination

Prerequisites

npm install --save moment

Installation

npm install --save feathers-data-table

Usage

This component can be used directly by importing and registering as a component.

<template>
    <feathers-data-table service="users" :headers="headers"/>
</template>
<script>
import { FeathersDataTable } from 'feathers-data-table';
export default {
    name: 'app',
    components: {
        FeathersDataTable,
    },
    data() {
        return {
            headers: [
              {text: 'Nombre', value: "name"},
              {text: 'Email', value: "email"},
            ]
        };
    },
};
</script>

Props

These are the available props of FeathersDataTable.

PropRequiredTypeDescription
serviceYesStringThe name of the feathersJS service
headersYesList of headerThis object defines the columns to be shown in the datatable
- header.textYesStringName of the column displayed in the table
- header.valueYesStringName of the attribute of the model of feathers response to be mapped to the column
- header.sortableNoBooleanWhether the column is sortable. If set to true the feathers service must support $sort in the query. Default: true
- header.labelMapNoObject: String -> StringObject to transform values of the response to texts
- header.classMapNoObject: String -> StringObject to apply css classes to cells based on values of response
- header.customslotNoBooleanWhether to use a custom slot for the column. If set to true the property header.itemslot must be set. Default: false
- header.itemslotNoStringName of the custom slot for the column when customslot is set to true
queryNoObjectFeathers query object to merge with the internal query object for pagination
after-fetchNoFunctionFucntion to transform the feathers response. The function should return the transformed data.
sort-byNoStringInitial column to sort by.