NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.56k stars 4.79k forks source link

使用官方示例 渲染 HTML dangerouslySetInnerHTML 不生效 #16426

Open ToQuery opened 2 months ago

ToQuery commented 2 months ago

相关平台

微信小程序

复现仓库

https://github.com/ToQuery/taro-nutui-bug.git 小程序基础库: 3.5.4 使用框架: React

复现步骤

taro 版本为:v4.0.5

期望结果

支持dangerouslySetInnerHTML

实际结果

无任何内容

环境信息

👽 Taro v4.0.5

  Taro CLI 4.0.5 environment info:
    System:
      OS: macOS 14.2.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
      Yarn: 1.22.22 - /opt/homebrew/bin/yarn
      npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.5 => 4.0.5 
      @tarojs/components: 4.0.5 => 4.0.5 
      @tarojs/helper: 4.0.5 => 4.0.5 
      @tarojs/plugin-framework-react: 4.0.5 => 4.0.5 
      @tarojs/plugin-html: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-alipay: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-h5: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-jd: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-qq: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-swan: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-tt: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-weapp: 4.0.5 => 4.0.5 
      @tarojs/react: 4.0.5 => 4.0.5 
      @tarojs/runtime: 4.0.5 => 4.0.5 
      @tarojs/shared: 4.0.5 => 4.0.5 
      @tarojs/taro: 4.0.5 => 4.0.5 
      @tarojs/taro-loader: 4.0.5 => 4.0.5 
      @tarojs/webpack5-runner: 4.0.5 => 4.0.5 
      babel-preset-taro: 4.0.5 => 4.0.5 
      eslint-config-taro: 4.0.5 => 4.0.5 
      react: ^18.0.0 => 18.3.1 
ToQuery commented 2 months ago
image image
TheKonka commented 2 months ago

可以在编译配置里面 临时加下这个 alias @tarojs/runtime': require.resolve('@tarojs/runtime')

ToQuery commented 2 months ago

可以在编译配置里面 临时加下这个 alias @tarojs/runtime': require.resolve('@tarojs/runtime')

临时显示了

gaoyan1998 commented 3 weeks ago

可以在编译配置里面 临时加下这个 alias @tarojs/runtime': require.resolve('@tarojs/runtime')

具体那个文件呢,我也有这个问题。4.0.5

TheKonka commented 3 weeks ago

可以在编译配置里面 临时加下这个 alias @tarojs/runtime': require.resolve('@tarojs/runtime')

具体那个文件呢,我也有这个问题。4.0.5

config/index.js