Taro 场景下 NutUI 默认设计尺寸是375,项目里设计稿用的 750 怎么办 #779
Answered
by
richard1015
richard1015
asked this question in
Q&A
-
如果直接使用 nutui 组件,会发现样式偏小的情况,这是因为 Taro 默认将 nutui 的样式尺寸从 px 转换为了 rpx,可以通过配置 selectorblacklist 来禁止转换。 配置方法 // config/index.js
const config = {
// ...
mini: {
postcss: {
pxtransform: {
enable: true,
config: {
selectorBlackList: [/nut-/]
}
}
}
},
} |
Beta Was this translation helpful? Give feedback.
Answered by
richard1015
Mar 24, 2022
Replies: 2 comments 2 replies
-
这样处理 会导致nutui 中的样式宽度最终输出为px |
Beta Was this translation helpful? Give feedback.
2 replies
-
解决方案看这个 #1122 Taro3.4.3版本之前: 解决方案
Taro3.4.3版本:解决方案
Taro3.4.3 具体变更内容可查看 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
richard1015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
解决方案看这个 #1122
Taro3.4.3版本之前: 解决方案
Taro3.4.3版本:解决方案
Taro3.4.3 具体变更内容可查看
https://github.com/NervJS/taro/tree/next/packages/postcss-pxtransform