add examples of what the props need to be
This commit is contained in:
parent
40f433125e
commit
9eed507daf
1 changed files with 35 additions and 0 deletions
|
@ -13,10 +13,45 @@
|
||||||
|
|
||||||
gl.VueGlPagination = Vue.extend({
|
gl.VueGlPagination = Vue.extend({
|
||||||
props: {
|
props: {
|
||||||
|
|
||||||
|
/**
|
||||||
|
This function will take the information given by the pagination component
|
||||||
|
And make a new API call from the parent
|
||||||
|
|
||||||
|
Here is an example `change` method:
|
||||||
|
|
||||||
|
change(pagenum, apiScope) {
|
||||||
|
window.history.pushState({}, null, `?scope=${apiScope}&p=${pagenum}`);
|
||||||
|
clearInterval(this.timeLoopInterval);
|
||||||
|
this.pageRequest = true;
|
||||||
|
this.store.fetchDataLoop.call(this, Vue, pagenum, this.scope, apiScope);
|
||||||
|
},
|
||||||
|
*/
|
||||||
|
|
||||||
change: {
|
change: {
|
||||||
type: Function,
|
type: Function,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
pageInfo will come from the headers of the API call
|
||||||
|
in the `.then` clause of the VueResource API call
|
||||||
|
there should be a function that contructs the pageInfo for this component
|
||||||
|
|
||||||
|
This is an example:
|
||||||
|
|
||||||
|
const pageInfo = (headers) => {
|
||||||
|
const values = {};
|
||||||
|
values.perPage = +headers['X-Per-Page'];
|
||||||
|
values.page = +headers['X-Page'];
|
||||||
|
values.total = +headers['X-Total'];
|
||||||
|
values.totalPages = +headers['X-Total-Pages'];
|
||||||
|
values.nextPage = +headers['X-Next-Page'];
|
||||||
|
values.previousPage = +headers['X-Prev-Page'];
|
||||||
|
return values;
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
pageInfo: {
|
pageInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
Loading…
Reference in a new issue