This project is an example of a Vue js component for listing data, with infinite scroll and always keeping loaded only 3 pages.
columns: {
type: Array,
required: true
},
data: {
type: Array,
required: true
},
total: {
type: Number,
required: true
},
uniqueKey: {
type: String,
default: () => {
return "id";
}
}
columns: [
{
name: "ID",
key: "_id",
type: "string"
},
{
name: "Email",
key: "email",
type: "string"
},
{
name: "Name",
key: "name",
type: "string"
},
{
name: "Company",
key: "company",
type: "string"
},
{
name: "Actions",
type: "actions",
actions: {
edit: {
visible: true,
label: "Edit",
classes: "btn btn-sm btn-success",
style: {
marginRight: '15px'
},
eventName: "editClick"
},
delete: {
visible: true,
label: "Delete",
classes: "btn btn-sm btn-danger",
eventName: "deleteClick"
}
}
}
],
uniqueKey: '_id',
npm install
npm run serve
npm run build
npm run lint