sorting by rank + pagination
This commit is contained in:
@@ -9,6 +9,15 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pagination flex justify-center mb-8">
|
||||
<Pagination
|
||||
:baseUrl="baseurl"
|
||||
:currentPage="$page.entries.pageInfo.currentPage"
|
||||
:totalPages="$page.entries.pageInfo.totalPages"
|
||||
:maxVisibleButtons="5"
|
||||
v-if="$page.entries.pageInfo.totalPages > 1"
|
||||
/>
|
||||
</div>
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
@@ -16,7 +25,7 @@
|
||||
|
||||
query($page:Int) {
|
||||
|
||||
entries: allBlog(perPage: 9, page: $page) @paginate {
|
||||
entries: allBlog(perPage: 10, page: $page, sortBy: "created", order: DESC) @paginate {
|
||||
totalCount
|
||||
pageInfo {
|
||||
totalPages
|
||||
@@ -49,6 +58,7 @@ query($page:Int) {
|
||||
|
||||
<script>
|
||||
import PostListItem from "~/components/PostListItem.vue";
|
||||
import Pagination from "~/components/Pagination.vue";
|
||||
|
||||
export default {
|
||||
metaInfo: {
|
||||
@@ -56,6 +66,12 @@ export default {
|
||||
},
|
||||
components: {
|
||||
PostListItem,
|
||||
Pagination
|
||||
},
|
||||
computed: {
|
||||
baseurl: function() {
|
||||
return ""
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user