-
-
Save ajcastro/83af279e7d7540f82cae791d9bd430f9 to your computer and use it in GitHub Desktop.
Quasar QTable Bottom Pagination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<q-table | |
:data="data" | |
:pagination="pagination" | |
@request="paginationRequest" | |
:columns="columns" | |
> | |
<template v-slot:top-left="props"> | |
<TablePagination | |
:pagination="props.pagination" | |
:filter="table.filter" | |
@request="request" | |
/> | |
</template> | |
</q-table> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import Bottom from 'quasar/src/components/table/table-bottom' | |
import Filter from 'quasar/src/components/table/table-filter' | |
import Pagination from 'quasar/src/components/table/table-pagination' | |
export default Vue.extend({ | |
mixins: [ | |
Bottom, | |
Filter, | |
Pagination | |
], | |
computed: { | |
computedRowsNumber () { | |
return this.pagination.rowsNumber | |
}, | |
isServerSide () { | |
return this.computedPagination.rowsNumber !== void 0 | |
} | |
}, | |
methods: { | |
requestServerInteraction (prop = {}) { | |
this.$nextTick(() => { | |
this.$emit('request', { | |
pagination: prop.pagination || this.computedPagination, | |
filter: prop.filter || this.filter, | |
getCellValue: this.getCellValue || (() => {}) | |
}) | |
}) | |
} | |
}, | |
render (h) { | |
return h('div', [ | |
this.getBottom(h) | |
]) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment