update
This commit is contained in:
@@ -6,9 +6,11 @@
|
|||||||
<div>
|
<div>
|
||||||
content: <p>{{ article.content }}</p>
|
content: <p>{{ article.content }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
createdAt: {{ article.createdAt }}
|
<div v-if="init">
|
||||||
|
createdAt: <span>{{ article.createdAt }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -19,13 +21,8 @@
|
|||||||
name: "Detail",
|
name: "Detail",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
article: {
|
article: {},
|
||||||
title: '',
|
init: false
|
||||||
content: '',
|
|
||||||
createdAt: '',
|
|
||||||
isOwn: null
|
|
||||||
},
|
|
||||||
pending: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async beforeCreate() {
|
async beforeCreate() {
|
||||||
@@ -33,7 +30,7 @@
|
|||||||
const articleId = this.$route.params.id;
|
const articleId = this.$route.params.id;
|
||||||
const result = await articleApi.getArticle.bind(this)(articleId);
|
const result = await articleApi.getArticle.bind(this)(articleId);
|
||||||
this.article = result.data;
|
this.article = result.data;
|
||||||
this.pending = false;
|
this.init = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
<router-link :to="{name: 'DetailArticle', params: {id: article.id}}"><span>{{ article.title }}</span></router-link>
|
<router-link :to="{name: 'DetailArticle', params: {id: article.id}}"><span>{{ article.title }}</span></router-link>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<router-link to="/articles/write">글쓰기</router-link>
|
<router-link to="/articles/write">글쓰기</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user