|
23 | 23 | usePrettyDate(comment.createTime) |
24 | 24 | }}</time> |
25 | 25 | <span v-if="comment.ipLocation" class="comment-ip-area" |
26 | | - >{{ t('component.comment.list.ipLocation') }}{{ comment.ipLocation }}</span |
| 26 | + >{{ t("component.comment.list.ipLocation") |
| 27 | + }}{{ comment.ipLocation }}</span |
27 | 28 | > |
28 | 29 | </div> |
29 | 30 | </div> |
|
44 | 45 | v-if="comment.imageList && comment.imageList.length" |
45 | 46 | class="comment-image-list" |
46 | 47 | > |
47 | | - <img |
| 48 | + <el-image |
48 | 49 | v-for="(image, imageIndex) in comment.imageList" |
49 | 50 | :key="imageIndex" |
50 | 51 | :src="image.url" |
| 52 | + :preview-src-list="comment.imageList.map((image) => image.url)" |
| 53 | + :initial-index="imageIndex" |
| 54 | + fit="cover" |
| 55 | + style="width: 82px; height: 82px" |
51 | 56 | /> |
52 | 57 | </div> |
53 | 58 | </div> |
|
58 | 63 | @click="like(comment)" |
59 | 64 | > |
60 | 65 | <i class="iconfont icon-like" /> |
61 | | - <span>{{ comment.liked ? t('component.comment.list.liked') : t('component.comment.list.like') }}</span> |
| 66 | + <span>{{ |
| 67 | + comment.liked |
| 68 | + ? t("component.comment.list.liked") |
| 69 | + : t("component.comment.list.like") |
| 70 | + }}</span> |
62 | 71 | <span v-if="comment.likeCount > 0">{{ comment.likeCount }}</span> |
63 | 72 | </div> |
64 | 73 | <div |
|
67 | 76 | @click="switchShowReply(comment)" |
68 | 77 | > |
69 | 78 | <i class="iconfont icon-comment" /> |
70 | | - <span>{{ reply.commentId === comment.id ? t('component.comment.list.cancelReply') : t('component.comment.list.reply') }}</span> |
| 79 | + <span>{{ |
| 80 | + reply.commentId === comment.id |
| 81 | + ? t("component.comment.list.cancelReply") |
| 82 | + : t("component.comment.list.reply") |
| 83 | + }}</span> |
71 | 84 | </div> |
72 | 85 | </div> |
73 | 86 | <div v-if="reply.commentId === comment.id" class="comment-reply-form"> |
@@ -208,7 +221,7 @@ const submitReply = async (parent) => { |
208 | 221 | ); |
209 | 222 | hideReply(); |
210 | 223 | appendReply(parent, ret); |
211 | | - useMsgSuccess(t('component.comment.list.publishSuccess')); |
| 224 | + useMsgSuccess(t("component.comment.list.publishSuccess")); |
212 | 225 | } catch (e) { |
213 | 226 | useCatchError(e); |
214 | 227 | } |
@@ -283,24 +296,9 @@ defineExpose({ |
283 | 296 | } |
284 | 297 | .comment-image-list { |
285 | 298 | margin-top: 10px; |
286 | | -
|
287 | | - img { |
288 | | - width: 72px; |
289 | | - height: 72px; |
290 | | - line-height: 72px; |
291 | | - cursor: pointer; |
292 | | - &:not(:last-child) { |
293 | | - margin-right: 8px; |
294 | | - } |
295 | | -
|
296 | | - object-fit: cover; |
297 | | - transition: all 0.5s ease-out 0.1s; |
298 | | -
|
299 | | - &:hover { |
300 | | - transform: matrix(1.04, 0, 0, 1.04, 0, 0); |
301 | | - backface-visibility: hidden; |
302 | | - } |
303 | | - } |
| 299 | + display: flex; |
| 300 | + flex-wrap: wrap; |
| 301 | + gap: 8px; |
304 | 302 | } |
305 | 303 | } |
306 | 304 |
|
@@ -340,7 +338,6 @@ defineExpose({ |
340 | 338 |
|
341 | 339 | .comment-replies { |
342 | 340 | margin-top: 10px; |
343 | | - // padding: 10px; |
344 | 341 | background-color: var(--bg-color2); |
345 | 342 | } |
346 | 343 | } |
|
0 commit comments