改富文本内图片的样式

let goodscontent = res.data.data.goods.detail;
const regex = new RegExp('<img', 'gi');
goodscontent= goodscontent.replace(regex, `<img style="width:100%;vertical-align: top;margin:0px auto;"`);
this.goodscontent = goodscontent;

posted @ 2021-12-15 19:47  Monroe_Yu  阅读(213)  评论(0编辑  收藏  举报