From 2158c12bff09d190e5f8994a6393f8469e047823 Mon Sep 17 00:00:00 2001 From: johnniang Date: Tue, 30 Apr 2019 11:23:22 +0800 Subject: [PATCH] Refactor query methods --- src/views/attachment/AttachmentList.vue | 11 ++++++----- src/views/post/PostList.vue | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/views/attachment/AttachmentList.vue b/src/views/attachment/AttachmentList.vue index 7764012e..8c8d0ed8 100644 --- a/src/views/attachment/AttachmentList.vue +++ b/src/views/attachment/AttachmentList.vue @@ -56,7 +56,7 @@ 查询 { this.attachments = response.data.data.content @@ -238,6 +235,10 @@ export default { this.queryParam.attachmentType = null this.loadAttachments() }, + handleQuery() { + this.queryParam.page = 0 + this.loadAttachments() + }, handleDelete(attachment) { this.loadAttachments() } diff --git a/src/views/post/PostList.vue b/src/views/post/PostList.vue index 008c704f..a36091de 100644 --- a/src/views/post/PostList.vue +++ b/src/views/post/PostList.vue @@ -53,7 +53,7 @@ 查询 { this.posts = response.data.data.content this.pagination.total = response.data.data.total @@ -321,6 +318,10 @@ export default { this.queryParam.status = null this.loadPosts() }, + handleQuery() { + this.queryParam.page = 0 + this.loadPosts() + }, handleEditStatusClick(postId, status) { postApi.updateStatus(postId, status).then(response => { this.$message.success('操作成功!')