代码碎片
<template>
<div>
<view :style="{ height: `${statusBarHeight}px` }"></view>
<view
class=""
:style="{
height: `${menuButtonHeight + menuButtonPadding * 2}px`,
width: `${menuButtonInfo.left}px`,
}"
>
<slot name="left"></slot>
<slot name="mid"></slot>
</view>
</div>
</template>
<script lang="ts" setup>
const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight
console.log('menuButtonInfo', menuButtonInfo)
console.log('statusBarHeight', statusBarHeight)
const menuButtonPadding = menuButtonInfo.top - statusBarHeight
const menuButtonHeight = menuButtonInfo.height
</script>
<style lang="scss" scoped>
//
</style>
