初始化代码
This commit is contained in:
29
uniapp/uni-app/components/uni-status-bar.vue
Normal file
29
uniapp/uni-app/components/uni-status-bar.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<view class="uni-status-bar" :style="style">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
computed: {
|
||||
style() {
|
||||
//#ifdef APP-PLUS
|
||||
return ''
|
||||
//#endif
|
||||
//#ifndef APP-PLUS
|
||||
return `height:${uni.getSystemInfoSync().statusBarHeight}px`
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.uni-status-bar {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
height: var(--status-bar-height);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user