metawesome-datatable
v1.0.45
Published
[![pipeline status](http://gitlab.meta.com.br/meta-awesome/datatable/badges/master/pipeline.svg)](http://gitlab.meta.com.br/meta-awesome/datatable/commits/master) [![coverage report](http://gitlab.meta.com.br/meta-awesome/datatable/badges/master/coverage.
Downloads
62
Keywords
Readme
metawesome-datatable
Datatable component with pagination and filters to be used with Meta Crud.
Installation
Via NPM:
$ npm install --save metawesome-datatable
Usage/Example
Just import it and use it as a directive:
<template>
<div id="app">
<datatable-panel :per-page="30" url="/api/fornecedores" :fields="fields" :sortField="fields[6]" :checkbox="'pe_cdsenior'" no-data-template="Nenhum registro encontrado." pagination-info-template="Mostrando {from} até {to} de {total}" ref="datatable"></datatable-panel>
</div>
</template>
<script>
import DatatablePanel from 'metawesome-datatable'
export default {
name: 'App',
components: {
DatatablePanel,
},
data() {
return {
fields: [
{ name: 'pe_cdsenior', sortField: 'pe_cdsenior', title: 'Código' },
{ name: 'pe_nome', sortField: 'pe_nome', title: 'Nome/R. Social' },
{ name: 'pe_razsoc', sortField: 'pe_razsoc', title: 'Fantasia' },
{ name: 'pe_tppessoa', sortField: 'pe_tppessoa', title: 'Tipo' },
{ name: 'pe_cpfcnpj', sortField: 'pe_cpfcnpj', title: 'CPF/CNPJ' },
{ name: 'status', sortField: 'status', title: 'Status' },
{ name: '__component:custom-ver-xml-envio', title: 'XML Envio' },
{ name: '__component:custom-ver-xml-retorno', title: 'XML Retorno' },
]
};
},
}
</script>
Build Setup
# install dependencies
$ npm install
# serve with hot reload at localhost:8080
$ npm run dev
# build for production with minification
$ npm run build