Skip to content
Snippets Groups Projects
Commit 37d4483b authored by Timothee P's avatar Timothee P :sunflower:
Browse files

display fifteenth feature

parent 94d531cc
No related branches found
No related tags found
No related merge requests found
......@@ -162,16 +162,16 @@
>
<span>
<a
v-for="(page, index) in nbPages"
:key="'page' + index"
v-for="pageNumber in nbPages"
:key="'page' + pageNumber"
:class="[
'paginate_button',
{ current: page.value === pagination.currentPage },
{ current: pageNumber === pagination.currentPage },
]"
aria-controls="table-features"
data-dt-idx="1"
tabindex="0"
>{{ page.value }}</a
>{{ pageNumber }}</a
>
</span>
<!-- // TODO : <span v-if="nbPages > 4" class="ellipsis">...</span> -->
......@@ -200,7 +200,7 @@ export default {
currentPage: 1,
pagesize: 15,
start: 0,
end: 14,
end: 15,
},
sort: {
column: "",
......@@ -254,10 +254,28 @@ export default {
return filterdFeatures.slice(this.pagination.start, this.pagination.end);
},
nbPages() {
let N = Math.round(
this.filteredFeatures.length / this.pagination.pagesize
);
console.log("N", N);
let rest = Math.round(
this.filteredFeatures.length % this.pagination.pagesize
);
console.log("rest", rest);
if (rest > 0) N++;
const arr = [...Array(N).keys()].map(function (x) {
++x;
return x;
});
console.log("arr", arr);
return arr;
},
displayedPageEnd() {
return this.pagination.end < 15
return this.filteredFeatures.length <= this.pagination.end
? this.filteredFeatures.length
: this.pagination.end + 1;
: this.pagination.end;
},
},
......@@ -283,24 +301,6 @@ export default {
}
},
nbPages() {
let N = Math.round(
this.filteredFeatures.length / this.pagination.pagesize
);
let rest = Math.round(
this.filteredFeatures.length % this.pagination.pagesize
);
if (rest > 0) N++;
const arr = [...Array(N).keys()].map(function (x) {
++x;
return {
index: x,
value: x,
};
});
return arr;
},
toPreviousPage() {
if (this.pagination.start > 0) {
this.pagination.start -= this.pagination.pagesize;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment