From c2070c808b78f0d98aed63e1fd9dca240ad7eb72 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Thu, 16 May 2019 22:23:27 +0800 Subject: [PATCH] Refactor CommentTab. --- src/views/dashboard/Dashboard.vue | 13 +++++- .../dashboard/components/RecentCommentTab.vue | 40 ++++++++++++++----- src/views/sheet/SheetList.vue | 6 +-- 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/src/views/dashboard/Dashboard.vue b/src/views/dashboard/Dashboard.vue index b6a99053..001cc5f2 100644 --- a/src/views/dashboard/Dashboard.vue +++ b/src/views/dashboard/Dashboard.vue @@ -118,8 +118,8 @@ {{ item.title }}
{{ item.createTime | timeAgo }}
@@ -297,6 +297,7 @@ import { PageView } from '@/layouts' import AnalysisCard from './components/AnalysisCard' import RecentCommentTab from './components/RecentCommentTab' import { mixin, mixinDevice } from '@/utils/mixin.js' +import optionApi from '@/api/option' import postApi from '@/api/post' import logApi from '@/api/log' @@ -323,6 +324,8 @@ export default { countsData: {}, journal: {}, logs: [], + options: [], + keys: ['blog_url'], logPagination: { page: 1, size: 50, @@ -334,6 +337,7 @@ export default { this.getCounts() this.listLatestPosts() this.listLatestLogs() + this.loadOptions() }, computed: { formattedPostData() { @@ -357,6 +361,11 @@ export default { } }, methods: { + loadOptions() { + optionApi.listAll(this.keys).then(response => { + this.options = response.data.data + }) + }, listLatestPosts() { postApi.listLatest(5).then(response => { this.postData = response.data.data diff --git a/src/views/dashboard/components/RecentCommentTab.vue b/src/views/dashboard/components/RecentCommentTab.vue index 1ea1b6ad..c82e734a 100644 --- a/src/views/dashboard/components/RecentCommentTab.vue +++ b/src/views/dashboard/components/RecentCommentTab.vue @@ -10,21 +10,33 @@ :key="index" > - - -