feat(PullRefresh): add success slot

This commit is contained in:
陈嘉涵
2019-12-27 15:02:09 +08:00
committed by neverland
parent f3857053d6
commit 56e450f29e
7 changed files with 142 additions and 37 deletions

View File

@@ -54,14 +54,12 @@ export default createComponent({
value(loading) {
this.duration = this.animationDuration;
if (!loading && this.successText) {
this.status = 'success';
setTimeout(() => {
this.setStatus(0);
}, this.successDuration);
if (loading) {
this.setStatus(this.headHeight, true);
} else if (this.slots('success') || this.successText) {
this.showSuccessTip();
} else {
this.setStatus(loading ? this.headHeight : 0, loading);
this.setStatus(0, false);
}
}
},
@@ -173,6 +171,14 @@ export default createComponent({
}
return nodes;
},
showSuccessTip() {
this.status = 'success';
setTimeout(() => {
this.setStatus(0);
}, this.successDuration);
}
},