Vueye table :
Description
It's a data table created using Vue.js, which has some features like :- Show data per page
- Sort columns
- Cells Custom rendering
- CRUD Actions
- Customize the columns display
- Filter data by fields
Installation :
npm install vueye-table --save
Requirements :
To make this component work with Vue 2, you should use the Vue composition-api plugin by importing it and using it in main.js as follows :
import Vue from 'vue';
import App from './App.vue';
import VueComp from '@vue/composition-api';
Vue.use(VueComp);
new Vue({
render: h => h(App),
}).$mount('#app');
Columns configuration:
The columns prop value could have the following structure :
columns: [
{
key: "id",
label: "ID",
sortable: true,
type: "number",
display: true
},
...
]
Key | Description |
---|---|
key | the corresponding field in the data array, it could be a path to a nested field |
label | the text to show in the table head |
sortable | Allow or not the column sorting |
type | the field type |
display | show the column |
Preview
Code
Employees
ID | Employee Name | Employee Salary | Address | Actions |
---|---|---|---|---|
1 | Tiger Nixon | 320800 | Gwenborough | |
2 | Garrett Winters | 170750 | Wisokyburgh | |
3 | Ashton Cox | 86000 | McKenziehaven | |
4 | Cedric Kelly | 433060 | South Elvis | |
5 | Airi Satou | 162700 | ||
6 | Brielle Williamson | 372000 | ||
7 | Herrod Chandler | 137500 | ||
8 | Rhona Davidson | 327900 | ||
9 | Colleen Hurst | 205500 | ||
10 | Sonya Frost | 103600 |