npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-table-js

v0.0.3

Published

Vue table component

Downloads

2

Readme

Installation

npm install vue-elastic-table --save

Hello world

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
<div id="app">
    <vue-elastic-table :columns="columns" :data="data"></vue-elastic-table>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/vue-table-js/dist/vue-table-js.iife.js"></script>
<!-- Boot Vue instance -->
<script>
    new Vue({
        el: '#app',
        components: { VueTableJs },
        data: {
            columns: ['id', 'name'],
            data: [
                {id: 1, name: 'John'},
                {id: 2, name: 'Mike'},
            ],
        },
    });
</script>
</html>

Component props

Columns

Data

  • type: Array<Object>
  • default: []

RowClass

  • type: String|Function
  • default: undefined

We can pass a string to v-bind:row-class to dynamically apply table row with specified class. If you would like to add custom logic, you can do it with function, which return value compatible with vue class bindings types.

function fn(item, index) {
  // item - current element in an array of data props
  // index  - index of element
  return ['foo', 'bar'];
}

MultipleSorting

  • type: Boolean
  • default: false

#Columns definition

key

  • type: String
  • default: undefined

Key of the data to be display. In multilevel headers you can leave the field undefined to combine different keys in one table column.

const column = {
    title: 'Foo',
    children: [
        'id', 
        'name'
    ]
}

title

  • type: String|Function|Object
  • default: undefined

Here you can define what will be rendered inside table header cell. Otherwise key option will be used. Using this option as function is useful with i18n. Also you can use vue components.

If you are using functional component you must provide v-bind and v-on by yourself

<template functional>
    <th v-bind="data.attrs" v-on="listeners">Custom table header</th>
</template>

#component

  • type: String|Object
  • default: undefined

The vue component that will be used for display data in table data cell.

<template>
    <td>
      <span class="foo bar">{{ data }}</span>
    </td>
</template>

<script>
    export default {
        props: {
            // The data of the selected by key path in current row
            data: {
                required: true,
            },
            // Other props available to be passed see in props below
        }
    }
</script>

#sortable

  • type: boolean|string
  • default: false

Define is a column are sortable. Using as string allows you override default behavior (full path of keys), see events

Appends to table header cell classes sortable, desc or asc

props

  • type: Object|Function
  • default: undefined

Additional props passed into component

transform

  • type Function|Array<Function>,
  • default: undefined

children

  • type: Array<Column>
  • default: undefined

Sub columns

{
    key: 'geo',
    title: 'Geolocation',
    children: [
        {key: 'lat', title: 'Latitude'},
        {key: 'lng', title: 'Longitude'},
    ],
},

#Events

sorted

Event fired when user clicked on sorted column. Example of incoming payload of event

[
    {column: 'id', direction: 'asc'},
    // if using multiple-sorting option 
    {column: 'name', direction: 'desc'},
    // if sortable option in column definition equals {..., sortable: 'my-custom-field', ...}
    {column: 'my-custom-field', direction: 'asc'},
]