Giter Club home page Giter Club logo

Comments (7)

jin-yufeng avatar jin-yufeng commented on May 25, 2024

提供可复现的 html 内容

from mp-html.

lqyc avatar lqyc commented on May 25, 2024

提供可复现的 html 内容

已提供,导出的一个常量文件,就是富文本内容。已测试该端富文本:

  • 用微信富文本组件可以显示图片:
<rich-text nodes="{{richNode}}"></rich-text> 
  • 用mp-html 不显示图片:
<mp-html  content="{{richNode}}" selectable="force" show-img-menu="{{true}}" />

富文本内容word文档:
富文本内容.docx

from mp-html.

lqyc avatar lqyc commented on May 25, 2024

提供可复现的 html 内容

有结论了吗?富文本已提供

from mp-html.

whoooami avatar whoooami commented on May 25, 2024

目前测试了一下。因为微信小程序会额外加一层view, 如场景1图1所示。这时候这层view的高宽为0, 所以内部图片如果指定100%,则图片宽高也为0,所以不显示。

任选一个即可。 [推荐1]

1、如果去掉富文本style 中的width:100%!important; 正常显示
2、修改组件mp-html/node/node.vue style ._img

/* 图片默认效果 */
._img {
    min-width: 720rpx; //新增部分
  max-width: 100%;
  -webkit-touch-callout: none;
}

from mp-html.

lqyc avatar lqyc commented on May 25, 2024

目前测试了一下。因为微信小程序会额外加一层view, 如场景1图1所示。这时候这层view的高宽为0, 所以内部图片如果指定100%,则图片宽高也为0,所以不显示。

任选一个即可。 [推荐1]

1、如果去掉富文本style 中的width:100%!important; 正常显示 2、修改组件mp-html/node/node.vue style ._img

/* 图片默认效果 */
._img {
    min-width: 720rpx; //新增部分
  max-width: 100%;
  -webkit-touch-callout: none;
}

我们按您的指示修改组件mp-html/node/node.vue style ._img的图片默认效果样式,但是这个最小图片宽度会影响小图的展示。有些图片可能只有不到720rpx宽度。
如图所示:去掉最新宽带才显示正常,如图:

from mp-html.

lqyc avatar lqyc commented on May 25, 2024

我们按您的指示修改组件mp-html/node/node.vue style ._img的图片默认效果样式,但是这个最小图片宽度会影响小图的展示。有些图片可能只有不到720rpx宽度。
如图所示: 去掉最新宽带才显示正常,如图:
企业微信截图_16915462947276

企业微信截图_16915462757367

from mp-html.

whoooami avatar whoooami commented on May 25, 2024

的确,方式2的侵入性会比较强,所以方案1的方式在您那边展现是?此外还需要麻烦提供最新可复现的html

from mp-html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.