vue-pagination

Repository

https://github.com/livelybone/vue-pagination

Example

View the print logs in the console
—— Know the total pages ——
—— Do not know the total pages ——

Code


new Vue({
el: '#module',
template: '<div class="wrap">' +
' <div class="wrap">View the print logs in the console</div>' +
' <div class="wrap">—— Know the total pages ——</div>' +
' <pagination :config="config"' +
' :input="{enable:false}"' +
' @to="log(\'config\',$event)"/>' +
' <div class="wrap">—— Do not know the total pages ——</div>' +
' <pagination :noPage="true"' +
' :config="noPageConfig"' +
' :turnBtns="turnBtns"' +
' :input="{text: \'To\', debonceTime: 2000}"' +
' @to="log(\'noPageConfig\',$event)"/>' +
'</div>',
data: function () {
return {
config: {
pages: 100,
page: 1,
pageSize: 10,
maxPageBtn: 6
},
noPageConfig: {
page: 1,
pageSize: 10,
currPageSize: 10
},
turnBtns: {
prev: '<span class="prev"></span>',
next: '<span class="next"></span>'
}
}
},
methods: {
log: function (type, val) {
console.log(type, ' to: ', val)
this[type].page = val
}
},
components: { pagination: Pagination }
})