onLoad(){ this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight console.log(this.statusBarHeight,'-') // this...._navigationstyle">
赞
踩
更改·后的代码
- <view :style="{height:statusBarHeight+'px'}" class="status"></view>
-
- 第一种:onLoad(){
- this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
- console.log(this.statusBarHeight,'-')
- // this.statusBarHeight = wx.getSystemInfoSync()['statusBarHeight']
-
- },
- 第二种:onLoad(){
- uni.getSystemInfo({
- success:(e)=> {
- console.log(e.statusBarHeight;)
- this.statusBarHeight = e.statusBarHeight;
- }
- })
- console.log(this.statusBarHeight,'-')
- },
- //css
- .status{
- width: 100%;
- background-color: red;
- }
-

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。