让 showToast 可以回调 complete
This commit is contained in:
@@ -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)
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user