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

<Button size="lg" /> 会被误转 #89

Closed
boringplay opened this issue Jul 18, 2023 · 11 comments
Closed

<Button size="lg" /> 会被误转 #89

boringplay opened this issue Jul 18, 2023 · 11 comments

Comments

@boringplay
Copy link

<Button size="lg" /> 会变成 <Button size_eqe_"lg" />

@MellowCo
Copy link
Owner

用的什么环境 taro uniapp 原生小程序?
代码示例?

@boringplay
Copy link
Author

taro webpack5 react

@MellowCo
Copy link
Owner

你是用了 transformerAttributify 吗

@boringplay
Copy link
Author

config 是这样的:

presets: [
    presetWind(),
    presetWeapp({
      // h5兼容
      isH5: process.env.TARO_ENV === 'h5',
      platform: 'taro',
      taroWebpack: 'webpack5',
    }),
  ],
  transformers: [
    transformerClass(),
    transformerDirectives({
      enforce: 'pre',
    }),
  ],
  content: {
    pipeline: {
      include: [/\.([jt]sx|css)($|\?)/],
      exclude: [],
    },
  }

@MellowCo
Copy link
Owner

MellowCo commented Jul 19, 2023

我测试了好像没有问题,小程序和h5没有出现问题

image

@MellowCo
Copy link
Owner

可能要提供一个代码片段,排查是不是正则匹配的问题

@boringplay
Copy link
Author

boringplay commented Jul 19, 2023

用仓库里的 examples 里可以复现。这样用就会浮现

<View className="">
    <Button size="lg">123123</Button>
</View>

@MellowCo
Copy link
Owner

因为 className="" 的问题,把这个删了或者别用 ""

@boringplay
Copy link
Author

临时这么改倒是可以,但是是不是要兼容这种场景呀?

@MellowCo
Copy link
Owner

sure

@MellowCo
Copy link
Owner

试试 0.53.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants