uni-status-bar.vue 481 字节
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1 2 3 4 5 6 7 8 9 10 11
<template>
	<view :style="{ height: statusBarHeight }" class="uni-status-bar">
		<slot />
	</view>
</template>

<script>
	export default {
		name: 'UniStatusBar',
		data() {
			return {
12
				statusBarHeight: 20
DCloud_JSON's avatar
DCloud_JSON 已提交
13
			}
14 15 16
		},
		mounted() {
			this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
DCloud_JSON's avatar
DCloud_JSON 已提交
17 18 19 20 21 22 23 24 25 26
		}
	}
</script>

<style lang="scss" scoped>
	.uni-status-bar {
		// width: 750rpx;
		height: 20px;
		// height: var(--status-bar-height);
	}
芊里 已提交
27
</style>