Skip to content

Commit

Permalink
Merge pull request #4130 from manipEgo/preview-features
Browse files Browse the repository at this point in the history
向 comment-apis 添加评论图片支持
  • Loading branch information
the1812 authored Apr 8, 2023
2 parents dd8822e + 110f50f commit 859eded
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/utils/comment-apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export interface CommentReplyItem {
}
/** 表示一条评论 */
export interface CommentItem extends CommentReplyItem {
/** 评论图片 */
pictures?: string[]
/** 回复 */
replies: CommentReplyItem[]
/** 回复有更新时调用此函数 */
Expand Down Expand Up @@ -101,6 +103,9 @@ const parseCommentItemV2 = (element: HTMLElement) => {
content: vueData.content.message,
time: vueData.ctime * 1000,
likes: vueData.like,
pictures: vueData.content?.pictures?.map(img => {
return img.img_src
}),
replies: parseReplies(),
}
if (item.replies.length < vueData.rcount) {
Expand Down

0 comments on commit 859eded

Please sign in to comment.