顶部菜单栏(在内部)
<mescroll-body :sticky="true" ref="mescrollRef" @init="mescrollInit" >
<!-- sticky吸顶悬浮的菜单, 父元素必须是 mescroll -->
<view class="sticky-tabs">
<caidanlan />
</view>
<!-- 数据列表 -->
</mescroll-body>
<style lang="scss">
.sticky-tabs{
z-index: 99;
position: sticky;
top: var(--window-top);
background-color: #fff;
}
</style>
## 参数“异”解读
- top :距离顶部的高度/偏移量
- 如: 在外部有一个高 60px 的元素,则 top 最小为 60px 否则就回被遮挡
- bottom : 距离底部的高度/偏移量
- 暂无使用过(都是默认)
- topbar: 取消原生导航栏时,配置此项可自动加上状态栏高度的偏移量(--status-bar-height)
- bottombar:tab页是否偏移TabBar的高度,避免列表被TabBar遮住, 默认true (仅h5生效)
- safearea:bottom的偏移量是否加上底部安全区的距离,适配iPhoneX时使用
-