add: 回复显示
This commit is contained in:
parent
cac01d8aa1
commit
1d26c243be
@ -32,7 +32,8 @@ div
|
|||||||
.comment-author {{ item.comment_author }}
|
.comment-author {{ item.comment_author }}
|
||||||
.comment-content {{ item.comment_content }}
|
.comment-content {{ item.comment_content }}
|
||||||
.comment-info {{ item.comment_date }}
|
.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-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
|
.comment-avatar
|
||||||
img(:src="i.comment_author_avatar_url ? i.comment_author_avatar_url : 'https://picsum.photos/100/100/?blur=' + i.user_id")
|
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-author {{ i.comment_author }}
|
||||||
.comment-content {{ i.comment_content }}
|
.comment-content {{ i.comment_content }}
|
||||||
.comment-info {{ i.comment_date }}
|
.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") 暂无内容
|
p(v-if="!comments.length", style="color: #cecece; text-align: center; margin-top: 40px") 暂无内容
|
||||||
.comment-default-commit
|
.comment-default-commit
|
||||||
.comment-userinfo
|
.comment-userinfo
|
||||||
@ -90,6 +92,7 @@ export default {
|
|||||||
commentAmount,
|
commentAmount,
|
||||||
showRightToc: false,
|
showRightToc: false,
|
||||||
tocIds: result.post_toc_ids,
|
tocIds: result.post_toc_ids,
|
||||||
|
replyLastID: null,
|
||||||
replyID: 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"/>'
|
text: '<img src="https://cdn.wyr.me/imgs/reward.jpg" style="max-width: 100%; width: 400px"/>'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
reply (id) {
|
reply (id, replyLastID, cancel) {
|
||||||
|
if (cancel) {
|
||||||
|
this.replyID = null
|
||||||
|
this.replyLastID = null
|
||||||
|
} else {
|
||||||
this.replyID = id
|
this.replyID = id
|
||||||
|
this.replyLastID = replyLastID
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
head () {
|
head () {
|
||||||
@ -565,6 +574,9 @@ footer .footer
|
|||||||
cursor pointer
|
cursor pointer
|
||||||
margin auto
|
margin auto
|
||||||
|
|
||||||
|
.vditor--fullscreen
|
||||||
|
z-index 9999999
|
||||||
|
|
||||||
@media (max-width: 768px)
|
@media (max-width: 768px)
|
||||||
.articleDetails
|
.articleDetails
|
||||||
padding 20px
|
padding 20px
|
||||||
|
Loading…
Reference in New Issue
Block a user