2018-09-07 13:31:05 +00:00
|
|
|
// MyVuetable.vue
|
2018-09-10 13:09:10 +00:00
|
|
|
<!-- :fields="['name', 'email', 'birthdate']" -->
|
|
|
|
// "https://vuetable.ratiw.net/api/users"
|
2018-09-07 13:31:05 +00:00
|
|
|
<template>
|
|
|
|
<vuetable ref="vuetable"
|
2018-09-10 13:09:10 +00:00
|
|
|
api-url="/api/persons"
|
|
|
|
v-bind:fields="fields" pagination-path=""
|
2018-09-07 13:31:05 +00:00
|
|
|
></vuetable>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Vuetable from "vuetable-2/src/components/Vuetable";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Vuetable
|
2018-09-10 13:09:10 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
fields: [
|
|
|
|
{
|
|
|
|
name: "full_name",
|
2018-09-11 08:05:25 +00:00
|
|
|
// sortField: "full_name"
|
2018-09-10 13:09:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "email",
|
2018-09-11 08:05:25 +00:00
|
|
|
sortField: "email"
|
2018-09-10 13:09:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "date_of_birth",
|
2018-09-11 08:05:25 +00:00
|
|
|
sortField: "date_of_birth",
|
2018-09-10 13:09:10 +00:00
|
|
|
// titleClass: "text-center",
|
|
|
|
// dataClass: "text-center",
|
|
|
|
// callback: "formatDate|DD-MM-YYYY"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "__component:custom-actions",
|
|
|
|
title: "Actions",
|
|
|
|
titleClass: "text-center",
|
|
|
|
dataClass: "text-center"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
css: {
|
|
|
|
table: {
|
|
|
|
tableClass: "table table-bordered table-striped table-hover",
|
|
|
|
ascendingIcon: "glyphicon glyphicon-chevron-up",
|
|
|
|
descendingIcon: "glyphicon glyphicon-chevron-down"
|
|
|
|
},
|
|
|
|
pagination: {
|
|
|
|
wrapperClass: "pagination",
|
|
|
|
activeClass: "active",
|
|
|
|
disabledClass: "disabled",
|
|
|
|
pageClass: "page",
|
|
|
|
linkClass: "link",
|
|
|
|
icons: {
|
|
|
|
first: "",
|
|
|
|
prev: "",
|
|
|
|
next: "",
|
|
|
|
last: ""
|
|
|
|
}
|
|
|
|
},
|
|
|
|
icons: {
|
|
|
|
first: "glyphicon glyphicon-step-backward",
|
|
|
|
prev: "glyphicon glyphicon-chevron-left",
|
|
|
|
next: "glyphicon glyphicon-chevron-right",
|
|
|
|
last: "glyphicon glyphicon-step-forward"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
sortOrder: [{ field: "email", sortField: "email", direction: "asc" }],
|
|
|
|
moreParams: {}
|
|
|
|
};
|
2018-09-07 13:31:05 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|