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

view标签上的style属性只能生成常规属性,var()函数可用属性无法生成,如"--main-color: #ff01cd" #7452

Closed
macholeopard opened this issue Aug 27, 2020 · 1 comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Milestone

Comments

@macholeopard
Copy link

相关平台

H5

浏览器版本: Chrome 84
使用框架: React

复现步骤

任意View标签加上含相关属性的style,如
<View style={{ '--main-color': '#ff01cd'}}> ... </View>

然后生成h5版。相同代码在weapp是可以生效的

期望结果

在生成的taro-view-core标签上带有style,如
<taro-view-core style="--main-color: #ff01cd;"> ... </taro-view-core>

实际结果

在生成的taro-view-core标签上没有style,如
<taro-view-core> ... </taro-view-core>

环境信息

Taro CLI 3.0.8 environment info:
    System:
      OS: macOS 10.15.6
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.16.1 - /usr/local/bin/node
      Yarn: 1.22.0 - /usr/local/bin/yarn
      npm: 6.13.4 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.0.8 => 3.0.8 
      @tarojs/components: 3.0.8 => 3.0.8 
      @tarojs/mini-runner: 3.0.8 => 3.0.8 
      @tarojs/react: 3.0.8 => 3.0.8 
      @tarojs/runtime: 3.0.8 => 3.0.8 
      @tarojs/taro: 3.0.8 => 3.0.8 
      @tarojs/webpack-runner: 3.0.8 => 3.0.8 
      babel-preset-taro: 3.0.8 => 3.0.8 
      eslint-config-taro: 3.0.8 => 3.0.8 
      react: ^16.10.0 => 16.13.1 
      taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.3 

补充信息

比较常见的主题色业务,我使用的是这样的方式,包括背景色字体色价格色等等,我都是使用这样的方式来进行的,在weapp一切正常在h5就没有生成这个style了

@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Aug 27, 2020
@Chen-jj Chen-jj added this to the 3.0.10 milestone Sep 3, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.10, 3.0.11 Sep 10, 2020
@ZakaryCode ZakaryCode modified the milestones: 3.0.11, 3.0.12 Sep 18, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.15, 3.0.16 Oct 23, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.16, 3.0.17 Nov 5, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.17, 3.0.18 Nov 17, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.18, 3.0.19 Dec 4, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.19, 3.0.20, 3.0.22 Dec 19, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.22, 3.1.0 Jan 4, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Jan 28, 2021

3.1.0-beta.5 修复

@Chen-jj Chen-jj closed this as completed Jan 28, 2021
This was referenced Feb 24, 2021
@ZakaryCode ZakaryCode moved this to Done in H5 Apr 10, 2023
@ZakaryCode ZakaryCode added this to H5 Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

3 participants