This commit is contained in:
@@ -35,7 +35,6 @@ export default {
|
|||||||
{
|
{
|
||||||
text: "Widget",
|
text: "Widget",
|
||||||
align: "left",
|
align: "left",
|
||||||
sortable: false,
|
|
||||||
value: "name"
|
value: "name"
|
||||||
},
|
},
|
||||||
{ text: "Serial", value: "serial" },
|
{ text: "Serial", value: "serial" },
|
||||||
@@ -49,22 +48,33 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
pagination: {
|
pagination: {
|
||||||
handler() {
|
handler() {
|
||||||
this.getDataFromApi().then(data => {
|
this.getDataFromApi();
|
||||||
this.Items = data.items;
|
/*
|
||||||
this.totalItems = data.total;
|
{
|
||||||
});
|
descending: false,
|
||||||
|
page: 1,
|
||||||
|
rowsPerPage: 5,
|
||||||
|
sortBy: "name",
|
||||||
|
totalItems: 0
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
// this.getDataFromApi().then(data => {
|
||||||
|
// this.Items = data.items;
|
||||||
|
// this.totalItems = data.total;
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loading = true;
|
this.getDataFromApi();
|
||||||
pagedList.fetch("Widget/ListWidgets", { Offset: 5, Limit: 5 }).then(res => {
|
// this.loading = true;
|
||||||
// debugger;
|
// pagedList.fetch("Widget/ListWidgets", { Offset: 5, Limit: 5 }).then(res => {
|
||||||
this.loading = false;
|
// // debugger;
|
||||||
this.Items = res.data;
|
// this.loading = false;
|
||||||
this.totalItems = res.paging.count;
|
// this.Items = res.data;
|
||||||
});
|
// this.totalItems = res.paging.count;
|
||||||
|
// });
|
||||||
|
|
||||||
// this.getDataFromApi().then(data => {
|
// this.getDataFromApi().then(data => {
|
||||||
// this.Items = data.items;
|
// this.Items = data.items;
|
||||||
@@ -72,6 +82,32 @@ export default {
|
|||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getDataFromApi() {
|
||||||
|
var listOptions = {
|
||||||
|
Offset: 0,
|
||||||
|
Limit: 5
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.pagination.rowsPerPage) {
|
||||||
|
listOptions.Limit = this.pagination.rowsPerPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.pagination.page) {
|
||||||
|
if (this.pagination.page > 0) {
|
||||||
|
listOptions.Offset = this.pagination.page * listOptions.Limit;
|
||||||
|
} else {
|
||||||
|
listOptions.Offset = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
pagedList.fetch("Widget/ListWidgets", listOptions).then(res => {
|
||||||
|
// debugger;
|
||||||
|
this.loading = false;
|
||||||
|
this.Items = res.data;
|
||||||
|
this.totalItems = res.paging.count;
|
||||||
|
});
|
||||||
|
}
|
||||||
// getDataFromApi() {
|
// getDataFromApi() {
|
||||||
// //http://localhost:7575/api/v8.0/Widget/ListWidgets?Offset=5&Limit=5
|
// //http://localhost:7575/api/v8.0/Widget/ListWidgets?Offset=5&Limit=5
|
||||||
// this.loading = true;
|
// this.loading = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user