f***@163.com
f***@163.com
  • 发布:2019-07-22 13:15
  • 更新:2020-05-09 11:49
  • 阅读:3145

使用var(--status-bar-height)提示不支持

分类:uni-app

代码
<template>
<view class="nav">
<view class="status-bar"></view>
<image class="logo-image" src="https://img-cdn-qiniu.dcloud.net.cn/static/images/logo1@2x.png"></image>
</view>
</template>

<script>
export default {
data() {
return {

        }  
    },  
    methods: {  

    }  
}  

</script>

<style >
.nav{
background-color: #007AFF;
height: 100%;
}
.status-bar{
width: 100%;
height:var(--status-bar-height);
}
.logo-image{
width: 100upx;
height: 40upx;
}

</style>
控制台提示
ERROR: property value var(--status-bar-height) is not supported for height (only number and pixel values are supported)

2019-07-22 13:15 负责人:无 分享
已邀请:
y***@foxmail.com

y***@foxmail.com

我用的nvue也好似不支持,楼主解决了吗

1***@qq.com

1***@qq.com

<template>  
    <view class="content">  
        <view :style="{ height: iStatusBarHeight + 'px'}"></view>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                iStatusBarHeight:0  
            }  
        },  
        onLoad() {  
            this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight  
        }  
    }  
</script>

该问题目前已经被锁定, 无法添加新回复