// :style="{paddingTop:paddingTop+ 'rpx'}" 这里是标签里的
//这里是data里的
// data() {
// return {
// paddingTop:'',
// };
// },
//这里是onLoad里的
// onLoad() {
// uni.getSystemInfo({
// success: res=> {
// console.log("屏幕信息", res);
// this.px2rpx(res.windowTop)
// }
// });
// },
//这里是methods里的函数
px2rpx(px) {
// :style="{paddingTop : `${px2rpxs(Custom.bottom)}rpx`}" class="container"
const system = uni.getSystemInfoSync()
this.paddingTop= px / system.windowWidth * 750
console.log(this.paddingTop)
},
转换px到rpx
最新推荐文章于 2023-11-13 21:17:19 发布