Skip to content
This repository has been archived by the owner on Oct 18, 2019. It is now read-only.

Latest commit

 

History

History
79 lines (55 loc) · 1.46 KB

README.md

File metadata and controls

79 lines (55 loc) · 1.46 KB

vue-modular-table

Flexible and covenient data table with Vue2 and no jquery

Usage

Installation

Using yarn

yarn add vue-modular-table

Using npm

npm i --save vue-modular-table

Quick setup

Import vue-modular-table

import ModularTable from 'vue-modular-table'

export default {
    components: { ModularTable }
}

and use it

<modular-table> </modular-table>

Requirements

Data

In order to work the table needs data in form of array of basic JS object or in JSON format

[
  {
    "id": 1,
    "name": "Leanne Graham",
    "email": "[email protected]"
  },
  {
    "id": 2,
    "name": "Ervin Howell",
    "email": "[email protected]"
  }
]

Definition

The unique part of Vue-modular-table is its definition. First you need to import the class that is responsible for construction of the definition.

import { TableDefinition } from 'vue-modular-table';

Then you need to define your table.

let myTableDefinition = new TableDefinition()
   .addColumn(column => column
       .addField('id', 'id'))
   .addColumn(column => column
       .addField('name', 'Names'))

For more detailed information how to define the table and use its functionality read the documentation.

License

This project is licensed under MIT License