This commit is contained in:
이진석
2020-02-04 11:33:27 +09:00
parent cd2e87bd55
commit 16fcb632f4
2 changed files with 9 additions and 10 deletions

View File

@@ -6,9 +6,11 @@
<div>
content: <p>{{ article.content }}</p>
</div>
<div>
createdAt: {{ article.createdAt }}
<div v-if="init">
createdAt: <span>{{ article.createdAt }}</span>
</div>
</div>
</template>
@@ -19,13 +21,8 @@
name: "Detail",
data() {
return {
article: {
title: '',
content: '',
createdAt: '',
isOwn: null
},
pending: true
article: {},
init: false
}
},
async beforeCreate() {
@@ -33,7 +30,7 @@
const articleId = this.$route.params.id;
const result = await articleApi.getArticle.bind(this)(articleId);
this.article = result.data;
this.pending = false;
this.init = true;
} catch (e) {
console.log(e);
}

View File

@@ -4,6 +4,8 @@
<router-link :to="{name: 'DetailArticle', params: {id: article.id}}"><span>{{ article.title }}</span></router-link>
</article>
<br>
<div>
<router-link to="/articles/write">글쓰기</router-link>
</div>