add: 回复显示

This commit is contained in:
yi-ge 2020-07-09 00:01:48 +08:00
parent cac01d8aa1
commit 1d26c243be

View File

@ -32,7 +32,8 @@ div
.comment-author {{ item.comment_author }}
.comment-content {{ item.comment_content }}
.comment-info {{ item.comment_date }}
span.reply(@click="reply(item.comment_ID)") 回复
span.reply(@click="reply(item.comment_ID, null, true)" v-if="replyLastID === null && item.comment_ID === replyID") 取消回复
span.reply(@click="reply(item.comment_ID, null)" v-else) 回复
.comment-item(v-for="(i, inx) in item.children", :key="inx", style="margin-top: 15px; margin-left: 50px; background-color: #eeeeee; border-radius: 4px;")
.comment-avatar
img(:src="i.comment_author_avatar_url ? i.comment_author_avatar_url : 'https://picsum.photos/100/100/?blur=' + i.user_id")
@ -40,7 +41,8 @@ div
.comment-author {{ i.comment_author }}
.comment-content {{ i.comment_content }}
.comment-info {{ i.comment_date }}
span.reply(@click="reply(item.comment_ID, i.comment_ID)") 回复
span.reply(@click="reply(item.comment_ID, i.comment_ID)" v-if="replyLastID !== i.comment_ID") 回复
span.reply(@click="reply(item.comment_ID, i.comment_ID, true)" v-else) 取消回复
p(v-if="!comments.length", style="color: #cecece; text-align: center; margin-top: 40px") 暂无内容
.comment-default-commit
.comment-userinfo
@ -90,6 +92,7 @@ export default {
commentAmount,
showRightToc: false,
tocIds: result.post_toc_ids,
replyLastID: null,
replyID: null
}
},
@ -324,8 +327,14 @@ export default {
text: '<img src="https://cdn.wyr.me/imgs/reward.jpg" style="max-width: 100%; width: 400px"/>'
})
},
reply (id) {
this.replyID = id
reply (id, replyLastID, cancel) {
if (cancel) {
this.replyID = null
this.replyLastID = null
} else {
this.replyID = id
this.replyLastID = replyLastID
}
}
},
head () {
@ -565,6 +574,9 @@ footer .footer
cursor pointer
margin auto
.vditor--fullscreen
z-index 9999999
@media (max-width: 768px)
.articleDetails
padding 20px