Skip to content

Commit

Permalink
Allow use of custom query params in vuestic-datatable (epicmaxco#170)
Browse files Browse the repository at this point in the history
* Allow use of custom query params in vuestic-datatable

* use camelcase to keep code style consistent
  • Loading branch information
pfrohner authored and smartapant committed Apr 23, 2018
1 parent fefdf57 commit 8ce46a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/tables/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
:sortFunctions="sortFunctions"
:apiMode="apiMode"
:paginationPath="paginationPath"
:queryParams="queryParams"
/>
</vuestic-widget>
</div>
Expand All @@ -201,6 +202,7 @@
import BadgeColumn from './BadgeColumn.vue'
import FieldsDef from 'vuestic-components/vuestic-datatable/data/fields-definition'
import ItemsPerPageDef from 'vuestic-components/vuestic-datatable/data/items-per-page-definition'
import QueryParams from 'vuestic-components/vuestic-datatable/data/query-params'
Vue.component('badge-column', BadgeColumn)
Expand All @@ -215,7 +217,8 @@
itemsPerPage: ItemsPerPageDef.itemsPerPage,
sortFunctions: FieldsDef.sortFunctions,
paginationPath: '',
defaultTablePerPage: 6
defaultTablePerPage: 6,
queryParams: QueryParams
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
:paginationPath="paginationPathComputed"
:appendParams="moreParams"
:perPage="perPage"
:queryParams="queryParams"
@vuetable:pagination-data="onPaginationData"
/>
<div class="d-flex justify-content-center mb-4">
Expand Down Expand Up @@ -130,6 +131,9 @@
paginationPath: {
type: String,
default: ''
},
queryParams: {
type: Object
}
},
data () {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
sort: 'sort',
page: 'page',
perPage: 'per_page'
}

0 comments on commit 8ce46a4

Please sign in to comment.