40
40
class =" reply-message"
41
41
>
42
42
<div class =" reply-username" >{{ replyUsername }}</div >
43
+
44
+ <div class =" image-reply-container" v-if =" isImageReply" >
45
+ <div
46
+ class =" message-image message-image-reply"
47
+ :style =" { background: `url(${message.replyMessage.file.url})` }"
48
+ ></div >
49
+ </div >
50
+
43
51
<div class =" reply-content" >{{ message.replyMessage.content }}</div >
44
52
</div >
45
53
@@ -215,6 +223,9 @@ export default {
215
223
isImage () {
216
224
return this .checkImageFile ()
217
225
},
226
+ isImageReply () {
227
+ return this .checkImageReplyFile ()
228
+ },
218
229
isImageLoading () {
219
230
return (
220
231
this .message .file .url .indexOf (' blob:http' ) !== - 1 || this .imageLoading
@@ -279,9 +290,15 @@ export default {
279
290
}, 300 )
280
291
},
281
292
checkImageFile () {
282
- if (! this .message .file ) return
293
+ return this .checkImageType (this .message .file )
294
+ },
295
+ checkImageReplyFile () {
296
+ return this .checkImageType (this .message .replyMessage .file )
297
+ },
298
+ checkImageType (file ) {
299
+ if (! file) return
283
300
const imageTypes = [' png' , ' jpg' ]
284
- const { type } = this . message . file
301
+ const { type } = file
285
302
return imageTypes .some (t => type .includes (t))
286
303
},
287
304
checkImgLoad () {
@@ -416,10 +433,14 @@ export default {
416
433
}
417
434
418
435
.image-container {
419
- padding-bottom : 2px ;
436
+ // padding-bottom: 2px;
420
437
width : 250px ;
421
438
}
422
439
440
+ .image-reply-container {
441
+ width : 70px ;
442
+ }
443
+
423
444
.image-loader {
424
445
top : 140px ;
425
446
}
@@ -437,6 +458,12 @@ export default {
437
458
transition : 0.4s filter linear ;
438
459
}
439
460
461
+ .message-image-reply {
462
+ height : 70px ;
463
+ width : 70px ;
464
+ margin : 4px auto 3px ;
465
+ }
466
+
440
467
.image-loading {
441
468
filter : blur (3px );
442
469
}
0 commit comments