zyejMAll-mobile/sheep/ui/su-status-bar/su-status-bar.vue
2024-10-21 17:47:58 +08:00

30 lines
630 B
Vue

<!-- 自定义状态栏 -->
<template>
<view :style="{ height: statusBarHeight,background: navbarbackgroundColor }" class="uni-status-bar" :class="navBg? 'ss' : ''" >
<slot />
</view>
</template>
<script setup>
import sheep from '@/sheep';
const props = defineProps({
navBg: {
type: Boolean,
default: false,
},
navbarbackgroundColor:{
type: String,
default: '',
}
})
const statusBarHeight = sheep.$platform.device.statusBarHeight - 2 + 'px';
</script>
<style lang="scss">
.uni-status-bar {
// width: 750rpx;
height: var(--status-bar-height);
}
.ss {
background: rgba(248, 83, 42);
}
</style>