Skip to content

Commit

Permalink
Bug Fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
poush committed May 15, 2016
1 parent e7ae8be commit fcaebab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-laravel-pagination",
"version": "1.0.1",
"version": "1.0.2",
"description": "Pagination for vuejs with bootstrap, works with any serverside framework (ready to use with laravel)",
"main": "vue-pagination.js",
"scripts": {
Expand Down
18 changes: 10 additions & 8 deletions vue-pagination.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
template: '<nav class=" {{navClass}} " v-if="visible">' +
template: '<nav class=" {{navClass}} " v-show="visible">' +
'<ul class="pagination {{size}} " >' +
'<li v-if="pagination.current_page > 1">' +
'<a href="#" aria-label="Previous" @click.prevent="changePage(1)">' +
Expand Down Expand Up @@ -37,13 +37,7 @@ module.exports = {
'</ul>' +
'</nav>',

data: function(){
return {
to : 0,
from: 0,
visible: 1
}
},

props: {
pagination: {
type: Object,
Expand All @@ -64,10 +58,16 @@ module.exports = {
offset: {
type: Number,
default: 4
},
visible: {
type: Number,
default: 1
}

},
computed: {
data: function () {

this.visible = 1;

var from = this.pagination.current_page - this.offset;
Expand All @@ -88,6 +88,8 @@ module.exports = {
from++;
}

console.log(arr);

if(arr.length == 1)
this.visible = 0

Expand Down

0 comments on commit fcaebab

Please sign in to comment.