<view class="tui-fixed-y">
<scroll-view class="tui-city-scroll-y" bindscroll="scroll" :scroll-into-view="toView" :scroll-y="true"
:enable-back-to-top="true" :scroll-anchoring="true" :scroll-with-animation="true">
<-- 内容 -->
</scroll-view>
</view>
<style>
.tui-fixed-y {
width: 100%;
height: calc(100% - 80rpx);
position: fixed;
bottom: 0;
top: 0;
left: 0;
}
.tui-city-scroll-y {
height: 100%;
box-sizing: border-box;
}
</style>
当页面内容过多产生滚动和scroll-view会产生冲突
解决办法:
让scroll-view包裹页面所有内容
当需要悬浮导航栏的时候 监听scroll-view的距离顶部的高度