提交 b56d890d 编写于 作者: DCloud_JSON's avatar DCloud_JSON

更新 优化单图片时的样式

上级 dab3c5ec
<template> <template>
<view class="uni-im-rich-text" <view class="uni-im-rich-text"
:class="{'isFromSelf':isFromSelf, 'only1u': trBody.length === 0 &&webInfoList.length === 1}"> :class="{'isFromSelf':isFromSelf, 'only1u': trBody.length === 0 &&webInfoList.length === 1 , isSingeImg}">
<template v-for="(item,index) in trBody" :index="index"> <template v-for="(item,index) in trBody" :index="index">
<template v-if="item.name == 'span'"> <template v-if="item.name == 'span'">
<text v-if="item.attrs && item.attrs.class == 'nickname'" class="text nickname" <text v-if="item.attrs && item.attrs.class == 'nickname'" class="text nickname"
...@@ -88,7 +88,10 @@ ...@@ -88,7 +88,10 @@
// } // }
// } // }
}, },
computed: { computed: {
isSingeImg() {
return this.msg.body.filter(item => item.name != 'img' && item.text).length === 0
},
imgList() { imgList() {
return this.msg.body.filter(item => item.name == 'img').map(item => item.attrs.src) return this.msg.body.filter(item => item.name == 'img').map(item => item.attrs.src)
}, },
...@@ -320,5 +323,11 @@ ...@@ -320,5 +323,11 @@
.web-info .link-box .copy:hover { .web-info .link-box .copy:hover {
opacity: 0.8; opacity: 0.8;
} }
/* #ifndef APP-NVUE */
.uni-im-rich-text.isSingeImg {
background-color: transparent !important;
padding: 0;
}
/* #endif */
</style> </style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册