Skip to content

Commit fcaebab

Browse files
committed
Bug Fix #1
1 parent e7ae8be commit fcaebab

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-laravel-pagination",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Pagination for vuejs with bootstrap, works with any serverside framework (ready to use with laravel)",
55
"main": "vue-pagination.js",
66
"scripts": {

vue-pagination.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
template: '<nav class=" {{navClass}} " v-if="visible">' +
2+
template: '<nav class=" {{navClass}} " v-show="visible">' +
33
'<ul class="pagination {{size}} " >' +
44
'<li v-if="pagination.current_page > 1">' +
55
'<a href="#" aria-label="Previous" @click.prevent="changePage(1)">' +
@@ -37,13 +37,7 @@ module.exports = {
3737
'</ul>' +
3838
'</nav>',
3939

40-
data: function(){
41-
return {
42-
to : 0,
43-
from: 0,
44-
visible: 1
45-
}
46-
},
40+
4741
props: {
4842
pagination: {
4943
type: Object,
@@ -64,10 +58,16 @@ module.exports = {
6458
offset: {
6559
type: Number,
6660
default: 4
61+
},
62+
visible: {
63+
type: Number,
64+
default: 1
6765
}
66+
6867
},
6968
computed: {
7069
data: function () {
70+
7171
this.visible = 1;
7272

7373
var from = this.pagination.current_page - this.offset;
@@ -88,6 +88,8 @@ module.exports = {
8888
from++;
8989
}
9090

91+
console.log(arr);
92+
9193
if(arr.length == 1)
9294
this.visible = 0
9395

0 commit comments

Comments
 (0)