A vue component for rendering datatables. With customizable sorting and searching capabilities.
Works with Vue 2.*
<script src="https://unpkg.com/accounting-js"></script>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vuejs-table-component"></script>
<script>
Vue.use(Datatable.default)
</script>
$ npm install vuejs-table-component --save
import Vue from 'vue'
import Datatable from 'vuejs-table-component'
export default {
name: 'App',
components: {
Datatable
}
}
import Vue from 'vue'
import Datatable from 'vuejs-table-component'
Vue.use(Datatable)
<template>
<datatable columns="columns" dataset="rows"></datatable>
</template>
<script>
import Datatable from 'vuejs-table-component'
export default {
name: 'App',
components: {
Datatable
},
data: () => ({
price: ''
}),
}
</script>
Props | Description | Required | Type | Default |
---|---|---|---|---|
columns | Corresponding columns of the table | true | Array | - |
dataset | Data to be used for pupulating the table | true | Array | - |
perpage | List of page sizes | false | Array | [10, 50, 100] |
indices | Fields that should be searchable by search | false | Array | [] |
search | A v-model value binded with a search field | false | String | '' |