Vue.js Wrapper for Tabulator

1.3.0 · active · verified Sun Apr 19

vue-tabulator is a Vue.js 2 component that serves as a declarative wrapper for the Tabulator JavaScript library, enabling easy integration of highly configurable and interactive data grids into Vue applications. The current stable version is 1.3.0. While its release cadence is not strictly regular, it receives updates driven by bug fixes and dependency upgrades, particularly for `tabulator-tables` and `vue` itself. Its key differentiator is providing a Vue-idiomatic approach to using Tabulator, allowing developers to manage table data via `v-model` and configure the grid through a `options` prop, abstracting away direct DOM manipulation. It is specifically designed for Vue 2, requiring `vue@^2.6.12` as a peer dependency, which is a critical consideration for project compatibility.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to globally register the `vue-tabulator` plugin, include Tabulator's base CSS, and render a basic data table using the `<VueTabulator>` component with `v-model` for data and `:options` for configuration in a Vue 2 application.

import Vue from 'vue';
import VueTabulator from 'vue-tabulator';
import 'tabulator-tables/dist/css/tabulator.min.css'; // Basic Tabulator CSS

Vue.use(VueTabulator);

new Vue({
  el: '#app',
  data: () => ({
    tableData: [
      {id:1, name:"Oli", age:"12", col:"red", dob:""},
      {id:2, name:"Mary", age:"1", col:"blue", dob:"14/05/1982"},
      {id:3, name:"Christine", age:"42", col:"green", dob:"22/05/1982"},
      {id:4, name:"Brendon", age:"16", col:"orange", dob:"01/08/1980"},
      {id:5, name:"Margret", age:"33", col:"yellow", dob:"31/01/1999"}
    ],
    tableOptions: {
      layout:"fitColumns",
      columns:[
        {title:"Name", field:"name", width:150},
        {title:"Age", field:"age", hozAlign:"left", formatter:"progress"},
        {title:"Favourite Color", field:"col"},
        {title:"Date Of Birth", field:"dob", sorter:"date", hozAlign:"center"}
      ]
    }
  }),
  template: `
    <div id="app">
      <h1>My Vue Tabulator Table</h1>
      <VueTabulator v-model="tableData" :options="tableOptions" />
    </div>
  `,
});

view raw JSON →