43 lines
873 B
JavaScript
43 lines
873 B
JavaScript
const MescrollCompMixin = {
|
|
onPageScroll(e) {
|
|
this.handlePageScroll(e)
|
|
},
|
|
onReachBottom() {
|
|
this.handleReachBottom()
|
|
},
|
|
onPullDownRefresh(){
|
|
this.handlePullDownRefresh()
|
|
},
|
|
data() {
|
|
return {
|
|
mescroll: {
|
|
onPageScroll: e=>{
|
|
this.handlePageScroll(e)
|
|
},
|
|
onReachBottom: ()=>{
|
|
this.handleReachBottom()
|
|
},
|
|
onPullDownRefresh: ()=>{
|
|
this.handlePullDownRefresh()
|
|
}
|
|
}
|
|
}
|
|
},
|
|
methods:{
|
|
handlePageScroll(e){
|
|
let item = this.$refs["mescrollItem"];
|
|
if(item && item.mescroll) item.mescroll.onPageScroll(e);
|
|
},
|
|
handleReachBottom(){
|
|
let item = this.$refs["mescrollItem"];
|
|
if(item && item.mescroll) item.mescroll.onReachBottom();
|
|
},
|
|
handlePullDownRefresh(){
|
|
let item = this.$refs["mescrollItem"];
|
|
if(item && item.mescroll) item.mescroll.onPullDownRefresh();
|
|
}
|
|
}
|
|
}
|
|
|
|
export default MescrollCompMixin;
|