uniapp解决rich"/>
uniapp解决rich
问题
如图所示,图片过大超出会超出手机屏幕:
解决办法
<rich-text preview image-menu-prevent class="hh" :nodes="content"></rich-text>onLoad(options) {this.index = options.indexif(options.detailList) {this.dataList = JSON.parse(decodeURIComponent(options.detailList))//解决图片不自动适应的问题 this.dataList.content是富文本展示的数据var richtext= this.dataList.content;const regex = new RegExp('<img', 'gi');richtext= richtext.replace(regex, `<img style="max-width: 100%;"`)this.content = richtext;}console.log(this.dataList);},.hh { //解决数字内容太多不换行的问题word-break: break-all;white-space: pre-warp;
}
更多推荐
uniapp解决rich
发布评论