Skip to content

Commit 46d0013

Browse files
authored
Merge pull request #8 from joebordes/pagination_urlparamsep
fix(Pagination) detect existence of question mark in URL in order to use correct parameter separator when adding parameters to the URL
2 parents fbaab25 + 0ef91bb commit 46d0013

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Pagination.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,12 @@ export const Pagination = {
265265
},
266266

267267
addPageParamToUrl(url, page) {
268-
return url + '?' + this._config.paramPage + '=' + page;
268+
if (url.indexOf('?')!=-1) {
269+
var paramsep = '&';
270+
} else {
271+
var paramsep = '?';
272+
}
273+
return url + paramsep + this._config.paramPage + '=' + page;
269274
},
270275

271276
getPageFromUrl(url) {

0 commit comments

Comments
 (0)