赞
踩
- <script>
- const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
- export default {
- data() {
- return {
- menuButtonInfo: menuButtonInfo, //右侧胶囊详细信息
- }
- },
- methods: {
-
- }
- }
- </script>
记得在page.json文件中设置当前页面隐藏默认标题栏哦,看最后
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
如下:
- <view
- :style="{ paddingTop: menuButtonInfo.top + 'px',height: menuButtonInfo.height + 'px'}">
- </view>
tips: 最好定义给menuButtonInfo一个初始值,否则页面初次渲染会有跳动的情况
- menuButtonInfo: {
- top: 51,
- height: 32,
- }, //右侧胶囊详细信息
"navigationStyle": "custom",
如图:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。