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

vue3+tsx使用插件好像没生效,帮忙看下哈 #11

Open
MaoSkin opened this issue Jul 10, 2023 · 3 comments
Open

vue3+tsx使用插件好像没生效,帮忙看下哈 #11

MaoSkin opened this issue Jul 10, 2023 · 3 comments

Comments

@MaoSkin
Copy link

MaoSkin commented Jul 10, 2023

归档.zip

@wswmsword
Copy link
Owner

#10 嗯,这个可能是 vite 配置的问题,元素的选择器被 vite 转成了 ._container_16a3w_1,插件生成的媒体查询的选择器还是原来的 .container,vite 没有把插件生成的媒体查询的选择器重命名成 ._container_16a3w_1,这个我再看看。

着急出效果的话可以用下面的配置:

module.exports = {
  plugins: [
    require("postcss-mobile-forever")({
      landscapeWidth: 450,
      maxDisplayWidth: 600,
      disableLandscape: true,
      disableDesktop: true,
      rootSelector: ".root-class",
    }),
  ],
};

这个配置不会生成媒体查询,一样限制最大宽度。

@MaoSkin
Copy link
Author

MaoSkin commented Jul 10, 2023

#10 嗯,这个可能是 vite 配置的问题,元素的选择器被 vite 转成了 ._container_16a3w_1,插件生成的媒体查询的选择器还是原来的 .container,vite 没有把插件生成的媒体查询的选择器重命名成 ._container_16a3w_1,这个我再看看。

着急出效果的话可以用下面的配置:

module.exports = {
  plugins: [
    require("postcss-mobile-forever")({
      landscapeWidth: 450,
      maxDisplayWidth: 600,
      disableLandscape: true,
      disableDesktop: true,
      rootSelector: ".root-class",
    }),
  ],
};

这个配置不会生成媒体查询,一样限制最大宽度。

好的,谢谢了

@wswmsword
Copy link
Owner

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