From b3dea14708bf30e39849668b5a31533c8153668f Mon Sep 17 00:00:00 2001 From: laowang Date: Thu, 12 May 2022 11:09:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7=E4=BD=93?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/detail.html | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/public/detail.html b/public/detail.html index 785b3b6..0f205c8 100644 --- a/public/detail.html +++ b/public/detail.html @@ -22,16 +22,25 @@
-

{{a.title}}

-
-
分类:{{a.category}}
-
发布于:{{a.publish_time}}
-
- 阅读数({{a.view_count}}) - 评论数({{a.comment_count}}) +
+

{{a.title}}

+
+
分类:{{a.category}}
+
发布于:{{a.publish_time}}
+
+ 阅读数({{a.view_count}}) + 评论数({{a.comment_count}}) +
+
+
+
+ + +
-
@@ -48,8 +57,9 @@ el: '#detail', // 设置挂载对象 data() { return { + isError:false, a: { - "id": 1, + "id": 0, "title": "", "cover": "", "publish_time": "", @@ -65,14 +75,14 @@ async created() { const params = qs.parse(location.search); if (!params.id) { - alert("文章的编号不正确") + this.isError = true; return; } const id = params.id; await request('./api/article/web/update', { id }) const articleList = await request('./api/article/web/detail', { id }); if (articleList.length != 1) { - alert('文章数据有问题'); + this.isError = true; return; } this.a = articleList[0];