You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
<template>
|
|
<view :style="[statusBarStyle]"></view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
bg: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
isMenuButton: {
|
|
type: Boolean,
|
|
default: false
|
|
}
|
|
},
|
|
computed: {
|
|
statusBarStyle () {
|
|
let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
|
|
let systemInfo = uni.getSystemInfoSync()
|
|
let statusBarHeight = this.isMenuButton ? systemInfo.statusBarHeight + menuButtonInfo.height : systemInfo.statusBarHeight
|
|
return { height: statusBarHeight + 'px', backgroundColor: this.bg }
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
</style>
|