update
This commit is contained in:
@@ -1,12 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
title : <span v-if="!pending">{{ article.title }}</span>
|
title : <span>{{ article.title }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
content: <p v-if="!pending">{{ article.content }}</p>
|
content: <p>{{ article.content }}</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
createdAt: {{ article.createdAt }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -17,13 +19,19 @@
|
|||||||
name: "Detail",
|
name: "Detail",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
article: null,
|
article: {
|
||||||
|
title: '',
|
||||||
|
content: '',
|
||||||
|
createdAt: '',
|
||||||
|
isOwn: null
|
||||||
|
},
|
||||||
pending: true
|
pending: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async beforeCreate() {
|
async beforeCreate() {
|
||||||
try {
|
try {
|
||||||
const result = await articleApi.getArticle.bind(this)(this.$route.params.id);
|
const articleId = this.$route.params.id;
|
||||||
|
const result = await articleApi.getArticle.bind(this)(articleId);
|
||||||
this.article = result.data;
|
this.article = result.data;
|
||||||
this.pending = false;
|
this.pending = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user