<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的距離頂部的高度