scroll-view scroll-y :style="{ 'height': getWindowHeight + 'rpx' }" @scroll="scroll" :scroll-top="scrollTop">
</scroll-view>
<image src="###" mode="widthFix" v-if="scrollTop>100" @click="scrollTop = 0" class="arrow"></image>
computed: {
getWindowHeight() {
let height = '';
uni.getSystemInfo({
success: function(res) {
height = res.windowHeight
},
});
return height * 2;
}
},
scroll(event) {
this.scrollTop = event.detail.scrollTop;
},
.arrow {
width: 80rpx;
position: fixed;
right: 30rpx;
bottom: 200rpx;
}
09-10
556
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-03
644
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-04
1349
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)