This commit is contained in:
@@ -58,28 +58,12 @@ export default {
|
|||||||
totalItems: 0
|
totalItems: 0
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// this.getDataFromApi().then(data => {
|
|
||||||
// this.Items = data.items;
|
|
||||||
// this.totalItems = data.total;
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getDataFromApi();
|
this.getDataFromApi();
|
||||||
// this.loading = true;
|
|
||||||
// pagedList.fetch("Widget/ListWidgets", { Offset: 5, Limit: 5 }).then(res => {
|
|
||||||
// // debugger;
|
|
||||||
// this.loading = false;
|
|
||||||
// this.Items = res.data;
|
|
||||||
// this.totalItems = res.paging.count;
|
|
||||||
// });
|
|
||||||
|
|
||||||
// this.getDataFromApi().then(data => {
|
|
||||||
// this.Items = data.items;
|
|
||||||
// this.totalItems = data.total;
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getDataFromApi() {
|
getDataFromApi() {
|
||||||
@@ -88,18 +72,12 @@ export default {
|
|||||||
Limit: 5
|
Limit: 5
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.pagination.rowsPerPage) {
|
if (this.pagination.rowsPerPage && this.pagination.rowsPerPage > 0) {
|
||||||
|
listOptions.Offset =
|
||||||
|
(this.pagination.page - 1) * this.pagination.rowsPerPage;
|
||||||
listOptions.Limit = 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;
|
this.loading = true;
|
||||||
pagedList.fetch("Widget/ListWidgets", listOptions).then(res => {
|
pagedList.fetch("Widget/ListWidgets", listOptions).then(res => {
|
||||||
// debugger;
|
// debugger;
|
||||||
@@ -108,41 +86,6 @@ export default {
|
|||||||
this.totalItems = res.paging.count;
|
this.totalItems = res.paging.count;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// getDataFromApi() {
|
|
||||||
// //http://localhost:7575/api/v8.0/Widget/ListWidgets?Offset=5&Limit=5
|
|
||||||
// this.loading = true;
|
|
||||||
// // eslint-disable-next-line
|
|
||||||
// return new Promise((resolve, reject) => {
|
|
||||||
// const { sortBy, descending, page, rowsPerPage } = this.pagination;
|
|
||||||
// let items = this.getItems();
|
|
||||||
// const total = items.length;
|
|
||||||
// if (this.pagination.sortBy) {
|
|
||||||
// items = items.sort((a, b) => {
|
|
||||||
// const sortA = a[sortBy];
|
|
||||||
// const sortB = b[sortBy];
|
|
||||||
// if (descending) {
|
|
||||||
// if (sortA < sortB) return 1;
|
|
||||||
// if (sortA > sortB) return -1;
|
|
||||||
// return 0;
|
|
||||||
// } else {
|
|
||||||
// if (sortA < sortB) return -1;
|
|
||||||
// if (sortA > sortB) return 1;
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// if (rowsPerPage > 0) {
|
|
||||||
// items = items.slice((page - 1) * rowsPerPage, page * rowsPerPage);
|
|
||||||
// }
|
|
||||||
// setTimeout(() => {
|
|
||||||
// this.loading = false;
|
|
||||||
// resolve({
|
|
||||||
// items,
|
|
||||||
// total
|
|
||||||
// });
|
|
||||||
// }, 1000);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user