Browse Source

Fixed post search error.

pull/9/head
ruibaby 6 years ago
parent
commit
c86b450d9b
  1. 7
      src/views/post/PostList.vue

7
src/views/post/PostList.vue

@ -53,7 +53,7 @@
<span class="table-page-search-submitButtons">
<a-button
type="primary"
@click="loadPosts"
@click="loadPosts(true)"
>查询</a-button>
<a-button
style="margin-left: 8px;"
@ -275,12 +275,15 @@ export default {
this.loadPosts()
},
methods: {
loadPosts() {
loadPosts(isSearch) {
this.postsLoading = true
// Set from pagination
this.queryParam.page = this.pagination.current - 1
this.queryParam.size = this.pagination.pageSize
this.queryParam.sort = this.pagination.sort
if (isSearch) {
this.queryParam.page = 0
}
postApi.query(this.queryParam).then(response => {
this.posts = response.data.data.content
this.pagination.total = response.data.data.total

Loading…
Cancel
Save