Skip to content

Commit

Permalink
More ES5 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbitron committed Jun 1, 2017
1 parent aac3585 commit d42e4b8
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/laravel-vue-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ module.exports = {
}
},

template: `
<ul class="pagination" v-if="data.total > data.per_page">
<li v-if="data.prev_page_url">
<a href="#" aria-label="Previous" @click.prevent="selectPage(--data.current_page)"><span aria-hidden="true">&laquo;</span></a>
</li>
<li v-for="n in getPages()" :class="{ 'active': n == data.current_page }"><a href="#" @click.prevent="selectPage(n)">{{ n }}</a></li>
<li v-if="data.next_page_url">
<a href="#" aria-label="Next" @click.prevent="selectPage(++data.current_page)"><span aria-hidden="true">&raquo;</span></a>
</li>
</ul>`,
template: '<ul class="pagination" v-if="data.total > data.per_page">\
<li v-if="data.prev_page_url">\
<a href="#" aria-label="Previous" @click.prevent="selectPage(--data.current_page)"><span aria-hidden="true">&laquo;</span></a>\
</li>\
<li v-for="n in getPages()" :class="{ \'active\': n == data.current_page }"><a href="#" @click.prevent="selectPage(n)">{{ n }}</a></li>\
<li v-if="data.next_page_url">\
<a href="#" aria-label="Next" @click.prevent="selectPage(++data.current_page)"><span aria-hidden="true">&raquo;</span></a>\
</li>\
</ul>',

methods: {
selectPage: function(page) {
Expand All @@ -41,7 +40,7 @@ module.exports = {
if (this.limit === -1) {
return 0;
}

if (this.limit === 0) {
return this.data.last_page;
}
Expand Down

0 comments on commit d42e4b8

Please sign in to comment.