A simple dynamic table build with vue.js
npm i --save vue-simple-dynamic-table
import VueTable from 'vue-simple-dynamic-table';
Vue.use(VueTable);
import VueTable from 'vue-simple-dynamic-table';
components:{
VueTable
}
<template>
<vue-table :heading="tableHeading" :headers="headers" :items="items"></vue-table>
</template>
<script>
import VueTable from 'vue-table';
...
components:{
...,
VueTable
},
data(){
return{
tableHeading: 'users',
headers: [
{key: 'firstName', label: 'First Name'},
{key: 'lastName', label: 'Last Name'},
{key: 'email', label: 'Email'},
{key: 'phone', label: 'Phone'},
{key: 'place', label: 'Place'},
],
items: [
{firstName: 'John', lastName: 'Doe', email: '[email protected]', phone: '1234567890'},
{firstName: 'Ben', lastName: 'Mathew', email: '[email protected]', phone: '1234567891'},
{firstName: 'Alex', lastName: 'Jose', email: '[email protected]', phone: '1234567892'},
]
}
}
...
</script>