Closed dodohack closed 5 years ago
Has implemented a quick version by modifying QPagination.js by adding code:
to: { query: Object.assign({}, this.$route.query, { page: i }) },
when calling this.__getBtn function, full code below:
for (let i = pgFrom; i <= pgTo; i++) { const active = i === this.value contentMiddle.push(this.__getBtn(h, { key:
bpg${i}
, style, on: { click: () => this.set(i) } }, { disable: this.disable, flat: !active, textColor: active ? this.textColor : null, label: i, to: { query: Object.assign({}, this.$route.query, { page: i }) }, ripple: false })) }
Prop to-fn
will be available in "quasar" v1.2.6.
QPagination is a great component with rich features, I have used it for my desktop version website for paged list.
It works as expected from the view of a user, however, when you want your next pages to be indexed by search engine, you will there is no way to make QPagination to display paginations as
<a href="/product-list?page=2">Page 2</a>
So for SSR rendered content, search engine will not be able to crawl subsequent pages as there is no anchor links present.
I think QPagination can render into anchor links instead of buttons to achieve this.