diff --git a/src/views/post/PostList.vue b/src/views/post/PostList.vue index 66554ce83..54e6ee5e5 100644 --- a/src/views/post/PostList.vue +++ b/src/views/post/PostList.vue @@ -60,7 +60,7 @@ >查询 重置 @@ -97,8 +97,8 @@ }" :columns="columns" :dataSource="formattedPosts" - :pagination="pagination" :loading="postsLoading" + :pagination="false" > 删除 + + + @@ -179,7 +193,11 @@ export default { return { postStatus: postApi.postStatus, // 查询参数 - pagination: {}, + pagination: { + current: 1, + pageSize: 10, + sort: null + }, queryParam: { page: 0, size: 10, @@ -263,8 +281,9 @@ export default { loadPosts() { this.postsLoading = true // Set from pagination - this.queryParam.page = this.pagination.current + this.queryParam.page = this.pagination.current - 1 this.queryParam.size = this.pagination.pageSize + this.queryParam.sort = this.pagination.sort postApi.query(this.queryParam).then(response => { this.posts = response.data.data.content this.pagination.total = response.data.data.total @@ -292,7 +311,24 @@ export default { name: post.title } } + }, + onPaginationChange(page, pageSize) { + this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`) + this.pagination.current = page + this.pagination.pageSize = pageSize + this.loadPosts() + }, + resetParam() { + this.queryParam.keyword = null + this.queryParam.categoryId = null + this.queryParam.status = null } } } + +