成都企业网站建设公司,石家庄网站建设汉狮怎么样,wordpress 有中文版吗,重庆在线高校开放平台今天拿到ui设计的图之后#xff0c;发现需要用到自定义navbar
给它设置height的时候#xff0c;一开始用的iphone X的屏幕#xff0c;像素单位用的rpx#xff0c;发现切换到别的屏幕就不对了
然后还是用iphone X的屏幕#xff0c;像素改成固定的88px#xff0c;发现有一…今天拿到ui设计的图之后发现需要用到自定义navbar
给它设置height的时候一开始用的iphone X的屏幕像素单位用的rpx发现切换到别的屏幕就不对了
然后还是用iphone X的屏幕像素改成固定的88px发现有一部分是可以的但是还有一部分是需要设置64px
废话不多说直接贴代码代码是vue3.0ts请用vue2.0的小伙伴自行修改一下
templateview classhomeuni-nav-barclickLeftback()backgroundColorrgba(0,0,0,0)color#fffleft-iconbackborderfalse:heightheight px/uni-nav-bar/view
/template
script langts setup
import { ref } from vue;
let height refnumber(0);
uni.getSystemInfo({success: function (e) {let custom uni.getMenuButtonBoundingClientRect();height.value custom.bottom custom.top - number(e.statusBarHeight) 4},
});
console.log(height.value)
let back () {};
/script
style scoped
import ../../common/css/home.css;
/style