NervJS / taro

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

3.6.1版本h5平台style不能使用字符串 #13293

Closed zuolung closed 1 year ago

zuolung commented 1 year ago

相关平台

H5

复现仓库

git@github.com:AntmJS/vantui.git 浏览器版本: chrom62 使用框架: React

复现步骤

期望结果

h5平台组件style可以使用字符串

实际结果

h5平台组件style使用字符串报错

环境信息

Taro v3.6.1

  Taro CLI 3.6.1 environment info:
    System:
      OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
      Shell: 5.1.4 - /bin/bash
    Binaries:
      Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
      npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.1 => 3.6.1 
      @tarojs/components: 3.6.1 => 3.6.1 
      @tarojs/helper: 3.6.1 => 3.6.1 
      @tarojs/plugin-framework-react: 3.6.1 => 3.6.1 
      @tarojs/plugin-platform-alipay: 3.6.1 => 3.6.1 
      @tarojs/plugin-platform-h5: 3.6.1 => 3.6.1 
      @tarojs/plugin-platform-jd: 3.6.1 => 3.6.1 
      @tarojs/plugin-platform-qq: 3.6.1 => 3.6.1 
      @tarojs/plugin-platform-swan: 3.6.1 => 3.6.1 
      @tarojs/plugin-platform-tt: 3.6.1 => 3.6.1 
      @tarojs/plugin-platform-weapp: 3.6.1 => 3.6.1 
      @tarojs/runtime: 3.6.1 => 3.6.1 
      @tarojs/shared: 3.6.1 => 3.6.1 
      @tarojs/taro: 3.6.1 => 3.6.1 
      @tarojs/webpack5-runner: 3.6.1 => 3.6.1 
      babel-preset-taro: 3.6.1 => 3.6.1 
      eslint-config-taro: 3.6.1 => 3.6.1 
      taro-ui: ^3.1.0-beta.2 => 3.1.0-beta.4 
zuolung commented 1 year ago
image
ZakaryCode commented 1 year ago

在 web 端 react 新版本适配器并未同步该特性,不建议如此使用(考虑与旧版本对齐,应当会同步该特性)

当前可以通过配置旧版本适配器修复该问题

yujingwyh commented 1 year ago

使用这个插件就可以了 https://www.npmjs.com/package/taro-plugin-string-style