最近使用Quill富文本编辑器,发现富文本中的图片太宽导致,在移动端超出屏幕
<view v-html="detail" class="detail-box"></view>
解决办法:
- 通过
>>>穿透修改
<style scoped>
.detail-box >>> img{
width: 100%;
}
<style>
2:通过正则来修改
this.detail = this.detail.replace(/<img/gi, '<img style="max-width:100%;height:auto" ');
最后
以上就是俊秀红酒最近收集整理的关于uniapp,vue 修改v-html中的样式的全部内容,更多相关uniapp,vue内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复