在data添加scrollTop:0,并在标签内添加动态绑定属性 :scrollTop,为左侧scroll-view 绑定点击事件,并添加语句如下: this.scrollTop = this.scrollTop === 0 ? 1 : 0
<scroll-view class="right-scroll-view" scroll-y="true" style="height: 300px;" :style="{height: wh + 'px'}" :scroll-top="scrollTop">
data() {
return {
wh: 0,
scrollTop: 0
};
}
onLoad() {
const sysInfo = uni.getSystemInfoSync()
this.wh = sysInfo.windowHeight // 屏幕可用高度
},
activeChange() {
this.scrollTop = this.scrollTop === 0 ? 1 : 0
},