uniapp解决rich

编程入门 行业动态 更新时间:2024-10-28 14:35:54

<a href=https://www.elefans.com/category/jswz/34/1769663.html style=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

本文发布于:2024-02-26 20:11:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1703745.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:uniapp   rich

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!