Skip to content

Commit e4e3a93

Browse files
committed
Do not show pagination if only one page is there is list
1 parent 410b2cc commit e4e3a93

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

vue-pagination.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
2-
template: '<nav class=" {{navClass}} ">' +
3-
'<ul class="pagination {{size}} ">' +
2+
template: '<nav class=" {{navClass}} " v-if="visible">' +
3+
'<ul class="pagination {{size}} " >' +
44
'<li v-if="pagination.current_page > 1">' +
55
'<a href="#" aria-label="Previous" @click.prevent="changePage(1)">' +
66
'<span aria-hidden="true">First</span>' +
@@ -40,7 +40,8 @@ module.exports = {
4040
data: function(){
4141
return {
4242
to : 0,
43-
from: 0
43+
from: 0,
44+
visible: 1
4445
}
4546
},
4647
props: {
@@ -84,6 +85,9 @@ module.exports = {
8485
arr.push(from);
8586
from++;
8687
}
88+
89+
if(arr.length == 1)
90+
this.visible = 0
8791

8892
return arr;
8993
}

0 commit comments

Comments
 (0)