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

components目录下无效 #1

Closed
jetBn opened this issue Mar 24, 2022 · 7 comments
Closed

components目录下无效 #1

jetBn opened this issue Mar 24, 2022 · 7 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@jetBn
Copy link

jetBn commented Mar 24, 2022

No description provided.

@ItsRyanWu
Copy link
Member

无效具体指的是什么?你可以提供一下复现案例吗?我在本地仓库无法复现

@jetBn
Copy link
Author

jetBn commented Mar 24, 2022

image
image

没有生效 就example 目录下

@jetBn
Copy link
Author

jetBn commented Mar 24, 2022

image

@ItsRyanWu
Copy link
Member

ItsRyanWu commented Mar 24, 2022

@jetBn 我检查了下,这其实是一个小程序的限制,若要想让组件可以被 tailwind/windi 生产的 CSS 作用到,需要在该组件的 JSON 配置文件中将 styleIsolation 选项设置为 shared 或者 apply-shared
在 MPX 中的具体示例为:

<script type="application/json">
  {
    "component": true,
    "styleIsolation": "shared"
  }
</script>

这是一个很好的问题,我会在文档中更新该注意事项。

@ItsRyanWu ItsRyanWu added good first issue Good for newcomers documentation Improvements or additions to documentation labels Mar 24, 2022
@3lang3
Copy link

3lang3 commented Jul 25, 2022

@ItsRyanWu taro react 项目中,非pages目录无效,如何设置 styleIsolation 属性呢?

@ItsRyanWu
Copy link
Member

@ItsRyanWu taro react 项目中,非pages目录无效,如何设置 styleIsolation 属性呢?

Taro 这个案例需要根据你的 repo 具体分析,和 styleIsolation 无关,如果确保使用了 jsx/tsx 后缀还是出现问题,请提供一下复现案例并创建新的 issue,谢谢。

@3lang3
Copy link

3lang3 commented Jul 25, 2022

@ItsRyanWu taro react 项目中,非pages目录无效,如何设置 styleIsolation 属性呢?

Taro 这个案例需要根据你的 repo 具体分析,和 styleIsolation 无关,如果确保使用了 jsx/tsx 后缀还是出现问题,请提供一下复现案例并创建新的 issue,谢谢。

#43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants