this.bottomDropped = true;
this.bottomReached = false;
if (this.bottomStatus === 'drop') {
this.translate = '-50';
this.bottomStatus = 'loading';
this.bottomMethod();
} else {
this.translate = '0';
this.bottomStatus = 'pull';
}
}
this.$emit('translate-change', this.translate);
this.direction = '';
}
}
总结
下拉刷新和上拉加载更多的实现原理可以借鉴
getScrollEventTarget()获取滚动对象,getScrollTop()获取滚动距离,checkBottomReached()判断是否滚动到底部;这三种方式可以借鉴
缺点: 写死了top slot 和 bottom slot的高度,太不灵活;这个地方可以优化










