收藏
回答

小程序的editor与rich-text组件中图片的问题?

<editor id="editor" class="ql-container" placeholder="{{placeholder}}" showImgSize showImgToolbar showImgResize bindstatuschange="onStatusChange" bindready="onEditorReady" bindinput="oninput">
</editor>
<rich-text nodes="{{html}}"></rich-text>

在小程序的editor组件的事例代码中添加了

<rich-text nodes="{{html}}"></rich-text>

这段代码,意思检查一下rich-text,当我添加图片时,rich-text编译的图片会大很多,超出全屏?

求解

回答关注问题邀请回答
收藏

3 个回答

  • hexford~🐶
    hexford~🐶
    2019-08-28

    insertImage 的時候設置下 class / widht&height 就可以了。

    editor 內部設置了最大寬度100%,放到 rich-text 里沒有這個限制了

    2019-08-28
    有用
    回复 1
    • Yhong
      Yhong
      2019-08-28
      恩恩,好的!问题已解决,谢谢!
      2019-08-28
      回复
  • 禾店短剧系统
    禾店短剧系统
    2021-06-11

    需要在节点内容填充前,重置图片的宽度

    例如:

    description = _description.replace(/\<img/gi, '<img style="width:100%;height:auto" ');

    // 内容显示

    <rich-text nodes='{{ description }}' ></rich-text>

    2021-06-11
    有用 1
    回复
  • จุ๊บ
    จุ๊บ
    2019-08-23

    设置图片样式 应该可以解决的

    2019-08-23
    有用
    回复
登录 后发表内容
问题标签