答案:
<div class="height"><div :style="height='height+px'"> 胶囊栏高度 <div /><div /><script>// #ifdef MP-WEIXINlet menuHeight = uni.getMenuButtonBoundingClientRect().heightthis.menuHeight = menuHeight// #endif</script><style >.height{height: var(--status-bar-height); // 此为顶部到胶囊栏高度}<style />
