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
taro + vue3 编译不会把px转化为rem或rpx响应式单位 #3
Comments
use rpx |
我只对 rpx 做了 响应式单位 转换 |
text-20rpx吗?那这样是不是就只能用在小程序编译了 |
taro h5看着是直接把rpx当成px去转化成rem了 |
taro 根字体不同版本还不同的 。。。 |
我说为什么 两边字体大小不同 。。。 |
升级到 0.1.11
presetWeapp(
// 375 标准
{
isH5: process.env.TARO_ENV === 'h5',
platform: 'taro',
designWidth: 375,
deviceRatio: {
375: 2 / 1,
750: 1,
},
taroWebpack: 'webpack5'
}
), |
const config = {
projectName: 'Taro3',
date: '2021-12-18',
designWidth: 640,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2,
375: 2 / 1
},
}
presetWeapp({
// h5兼容
isH5: process.env.TARO_ENV === 'h5',
platform: 'taro',
designWidth: 640,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2,
375: 2 / 1
},
taroWebpack: 'webpack5'
}) |
那设计稿是375的话,也是需要设置成640吗? |
和 taro config 里的保持一致就行,我只是用 640 测试了下 |
谢谢大佬,375测试了一下也可以了👍 |
你是mac电脑,@unocss/webpack 0.45.8 之后,unocss 会不生成 css 代码 |
我用的是mac,倒是没遇到过这种情况😂 |
复现仓库
https://github.com/yanbowe/taro-vue3-pinia
编译到h5或小程序均不会转化为响应式单位
The text was updated successfully, but these errors were encountered: