解决富文本在小程序里图片的大小问题

利用正则解决

//this.datas是富文本的内容
this
.datas = this.datas.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');

一行解决

posted @ 2021-08-06 17:19  blackAge  阅读(402)  评论(0)    收藏  举报