富文本img标签添加类名
This commit is contained in:
parent
af176ea03e
commit
2ba43a28d2
@ -53,7 +53,8 @@ export default {
|
|||||||
this.pics = pics
|
this.pics = pics
|
||||||
this.goods_name = goods_name
|
this.goods_name = goods_name
|
||||||
this.goods_price = goods_price
|
this.goods_price = goods_price
|
||||||
this.goods_introduce = goods_introduce
|
// 给富文本中的img标签添加类名
|
||||||
|
this.goods_introduce = goods_introduce.replace(/<img/g, '<img class="img"')
|
||||||
},
|
},
|
||||||
showBigImgHandle(current){
|
showBigImgHandle(current){
|
||||||
const urls = this.pics.map(item => item.pics_big)
|
const urls = this.pics.map(item => item.pics_big)
|
||||||
@ -118,4 +119,17 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style> </style>
|
|
||||||
|
.detail_title {
|
||||||
|
height: 80rpx;
|
||||||
|
display: flex;
|
||||||
|
font-size: 26rpx;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
// 小程序规定,要修改富文本的标签样式,只能通过类选择器修改,不支持HTML标签选择器
|
||||||
|
.img {
|
||||||
|
/* 覆盖默认基线对齐造成的图片底部缝隙影响 */
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue
Block a user