1、在JS中我们获取数据,在没有类名的情况下
使用正则匹配你想要添加演示的节点
res[1].data[0].f_content为rich-text里面的节点
如图
代码:让获取的节点中的图片的最大宽度为100%,高度为auto
this.content = res[1].data[0].f_content.replace(/\<img/gi, '<img style="width:100%";height:auto')
初始状态:图片超过div
效果: