add nova
This commit is contained in:
26
nova/resources/js/mixins/Paginatable.js
Normal file
26
nova/resources/js/mixins/Paginatable.js
Normal file
@@ -0,0 +1,26 @@
|
||||
export default {
|
||||
methods: {
|
||||
/**
|
||||
* Select the previous page.
|
||||
*/
|
||||
selectPreviousPage() {
|
||||
this.updateQueryString({ [this.pageParameter]: this.currentPage - 1 })
|
||||
},
|
||||
|
||||
/**
|
||||
* Select the next page.
|
||||
*/
|
||||
selectNextPage() {
|
||||
this.updateQueryString({ [this.pageParameter]: this.currentPage + 1 })
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
/**
|
||||
* Get the current page from the query string.
|
||||
*/
|
||||
currentPage() {
|
||||
return parseInt(this.queryStringParams[this.pageParameter] || 1)
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user