[Improvement] List: add check method (#1590)

This commit is contained in:
neverland
2018-08-05 17:57:05 +08:00
committed by GitHub
parent 428cb5059a
commit fe5aae7515
3 changed files with 21 additions and 5 deletions

View File

@@ -41,7 +41,7 @@ export default create({
this.handler(true);
if (this.immediateCheck) {
this.$nextTick(this.onScroll);
this.$nextTick(this.check);
}
},
@@ -59,16 +59,16 @@ export default create({
watch: {
loading() {
this.$nextTick(this.onScroll);
this.$nextTick(this.check);
},
finished() {
this.$nextTick(this.onScroll);
this.$nextTick(this.check);
}
},
methods: {
onScroll() {
check() {
if (this.loading || this.finished) {
return;
}
@@ -109,7 +109,7 @@ export default create({
/* istanbul ignore else */
if (this.binded !== bind) {
this.binded = bind;
(bind ? on : off)(this.scroller, 'scroll', this.onScroll);
(bind ? on : off)(this.scroller, 'scroll', this.check);
}
}
}