[Feature Request] 增加组件回执方法的同步特性
- Dominant language
- Vue
- Stars
- 54k
- Forks
- 14.4k
- PR merge metrics
- No merged PRs in 30d
Description
### Existing Component
是
### Component Name
所有组件
### Description
情景:
第一个组件回执方法的返回值决定第一个组件是否继续继续运行,第一组件回执方法默认回执true
第二组件在第一组件的回执方法中,通过第二组件的回执方法的返回值,来确定第一组件是否继续运行
问题:
第二组件的回执方法属于异步方法,当需执行第二组件的回执方法时,程序会自动跳过回执方法的执行,致使第一组件直接返回了默认值true
代码:
beforeUpload() {//上传组件,上传前拦截方法,无return时默认为true
if(this.list.entityList.length>0) {
this.$confirm('上传将清除已上传项目,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if(action == 'confirm') return true
else {
this.$message({
type: 'info',
message: '已取消上传'
});
return false
}
}
})
}
},
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.