Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用dangerouslySetInnerHTML的时候 内联标签样式不能全部完整展示 #8804

Closed
liaojin1 opened this issue Mar 3, 2021 · 2 comments
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@liaojin1
Copy link

liaojin1 commented Mar 3, 2021

相关平台

微信小程序

小程序基础库: 1.80.1.18
使用框架: React

复现步骤

{fuzzySearchList ? <view className='fuzzy_search'>
            {[1, 2].map(() => {
              let html = `<view>n<view style='color: #1966FF; display: inline;>i</view>ke</view>`;
              return <View className='fuzzy_search_item' dangerouslySetInnerHTML={{ __html: html }}></View>
            })}
        </view> : null}

期望结果

期望可以把html中的内联样式以及后边的字母展示出来

实际结果

只渲染展示了第一个字母n,后边全都不展示

环境信息

 Taro v2.1.0


  Taro CLI 2.1.0 environment info:
    System:
      OS: macOS 10.14.6
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 12.18.3 - /usr/local/bin/node
      Yarn: 1.22.5 - /usr/local/bin/yarn
      npm: 6.14.6 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.0.26 => 3.0.26
      @tarojs/components: 3.0.26 => 3.0.26
      @tarojs/mini-runner: 3.0.26 => 3.0.26
      @tarojs/taro: 3.0.26 => 3.0.26
      @tarojs/webpack-runner: 3.0.26 => 3.0.26
      eslint-config-taro: 3.0.26 => 3.0.26
      react: ^16.10.0 => 16.14.0
      taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.10
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Mar 3, 2021
@liaojin1
Copy link
Author

liaojin1 commented Mar 3, 2021

image
只展示了第一个字母n后边的内敛样式以及字母都没有渲染

@liaojin1 liaojin1 closed this as completed Mar 3, 2021
@liaojin1
Copy link
Author

liaojin1 commented Mar 3, 2021

手滑style少点一个闭合引号已close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

1 participant