让 showToast 可以回调 complete

This commit is contained in:
Luk Lu
2020-06-24 12:19:09 +08:00
parent ff7dc3ce3a
commit 6c3819c544
2 changed files with 17 additions and 15 deletions

View File

@@ -47,7 +47,7 @@ based on
this.popup_list.push(toast)
if(!toast.clickable){
this.disappear(toast.uuid,toast.duration)
this.disappear(toast.uuid,toast.duration,toast.complete)
}//可点击消失
else{
this.$emit('uuidCallback',toast.uuid)
@@ -55,7 +55,7 @@ based on
},
//自动消失
disappear:function(uuid,duration){
disappear:function(uuid,duration,complete){
//退出动画之后,短暂延迟后移除本元素
this.fade_out_animator(uuid,duration).then(res=>{
setTimeout(()=>{
@@ -66,6 +66,9 @@ based on
this.$forceUpdate()
}
}
if (typeof(complete)==='function'){
complete()
}
},250)
})
},