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

如果我希望在980宽度以下,不再进行缩放,怎么配置呢? #21

Closed
intelligenceFY opened this issue Jan 2, 2024 · 5 comments

Comments

@intelligenceFY
Copy link

No description provided.

@wswmsword
Copy link
Owner

现在还不支持这个功能,只能大于某个宽度不缩放。请问您是在什么场景希望小于某宽度不缩放?

@intelligenceFY
Copy link
Author

项目是web端的,然后引入了一个postcss做适配,放大缩小。但是到小于980的时候页面会乱掉 所以我希望是980以下都不再缩放。按理说应该和大于某个宽度不再放大是一个原理

@wswmsword
Copy link
Owner

最新版本 4.0.1 已添加新属性 experimental.minDisplayWidth 来限制最小宽度,可以像下面这样配置:

{
  "appSelector": "#app",
  "maxDisplayWidth": 1440,
  "experimental": {
    "minDisplayWidth": 980
  }
}

@intelligenceFY
Copy link
Author

完美解决了,比之前的postcss-px-to-viewport适配更好了,我实现了1600不放大,980以下不缩小,目前还有点微调问题,不过影响不大。减少了两套代码的工作量,nice。作者大大加鸡腿

@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