{{a.title}}
-
-
@@ -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];
分类:{{a.category}}
- 发布于:{{a.publish_time}}
-
- 阅读数({{a.view_count}})
- 评论数({{a.comment_count}})
+
+
+
+
+ 返回
+
+
-