Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

[问题]如何禁止Style样式被转化? #1869

Closed
codedart2018 opened this issue Mar 29, 2022 · 5 comments · Fixed by #1870
Closed

[问题]如何禁止Style样式被转化? #1869

codedart2018 opened this issue Mar 29, 2022 · 5 comments · Fixed by #1870
Labels
question Further information is requested

Comments

@codedart2018
Copy link

codedart2018 commented Mar 29, 2022

问题描述
用了css变量,变量传过去给转换成了px.这不是我想要的结果。希望我传入什么它原样就是什么。

示例代码

  const sty: GridProps['style'] & Record<'--columns', string> = {
    '--columns': `${props.columns.toString()}`,
    ...style,
  };

其他信息
image

image

@codedart2018 codedart2018 added the question Further information is requested label Mar 29, 2022
@yesmeck
Copy link
Member

yesmeck commented Mar 29, 2022

你试试用原生小程序会这样吗?如果原生小程序没问题,传个可重现的 demo 上来看看。

@codedart2018
Copy link
Author

不是用的原生。remaxjs写的一个Grid组件

@codedart2018
Copy link
Author

image

原生小程序,不会转!原生是你写的啥就是啥吧!你们可以在style上尝试下变量。不光是变量。有时候也可能不会让style转换吧!

@yesmeck
Copy link
Member

yesmeck commented Mar 29, 2022

@codedart2018 提供一个可重现的 demo 吧。

@codedart2018
Copy link
Author

components.zip
组件传上来了

        <Grid columns={2}>
          <GridItem className='list-item'>a</GridItem>
          <GridItem className='list-item'>b</GridItem>
        </Grid>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants