页面添加滚动事件
onPageScroll(res) {
uni.$emit('onPageScroll', res.scrollTop);
},
对应的子组件添加监听
mounted() {
var that = this;
uni.$on('onPageScroll', function(data) {
console.log(data);
that.scrollTop = data;
});
},