H5 设置 useHtmlComponents = true 使用 Taro.previewImage 预览图片无法正确渲染

nqwrtyyt  于 2022-12-31  发布在  其他
关注(0)|答案(1)|浏览(134)

相关平台

H5

浏览器版本: 谷歌最新版
使用框架: React

复现步骤

<Button
            type="primary"
            onClick={(): void => {
              Taro.previewImage({
                urls: [
                  'https://t7.baidu.com/it/u=4198287529,2774471735&fm=193&f=GIF',
                  'https://t7.baidu.com/it/u=3908717,2002330211&fm=193&f=GIF'
                ]
              })
            }}
          >
            <Text>Taro.previewImage</Text>
          </Button>

渲染结果:

单纯使用Swiper组件渲染是正确的

期望结果

Taro.previewImage 应该正确创建Swiper 组件

实际结果

Taro.previewImage 没有正确创建Swiper 组件

环境信息

Taro CLI 3.2.0 environment info:
    System:
      OS: macOS 11.3
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 15.12.0 - /opt/homebrew/bin/node
      Yarn: 1.22.10 - /opt/homebrew/bin/yarn
      npm: 7.6.3 - /opt/homebrew/bin/npm
    npmPackages:
      @tarojs/components: 3.2.8 => 3.2.8 
      @tarojs/mini-runner: 3.2.8 => 3.2.8 
      @tarojs/react: 3.2.8 => 3.2.8 
      @tarojs/router: ^3.2.8 => 3.2.8 
      @tarojs/runtime: 3.2.8 => 3.2.8 
      @tarojs/taro: 3.2.8 => 3.2.8 
      @tarojs/webpack-runner: 3.2.8 => 3.2.8 
      babel-preset-taro: 3.2.8 => 3.2.8 
      eslint-config-taro: 3.2.8 => 3.2.8 
      react: ^17.0.0 => 17.0.2 
    npmGlobalPackages:
      typescript: 4.3.0-dev.20210406

相关问题