@uiw/react-modal
Advanced tools
Comparing version 4.18.0 to 4.18.1
{ | ||
"name": "@uiw/react-modal", | ||
"version": "4.18.0", | ||
"version": "4.18.1", | ||
"description": "Modal component", | ||
@@ -47,7 +47,7 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"dependencies": { | ||
"@uiw/react-button": "^4.18.0", | ||
"@uiw/react-icon": "^4.18.0", | ||
"@uiw/react-overlay": "^4.18.0", | ||
"@uiw/utils": "^4.18.0" | ||
"@uiw/react-button": "^4.18.1", | ||
"@uiw/react-icon": "^4.18.1", | ||
"@uiw/react-overlay": "^4.18.1", | ||
"@uiw/utils": "^4.18.1" | ||
} | ||
} |
@@ -93,2 +93,3 @@ Modal 模态对话框 | ||
} | ||
this.time = null | ||
} | ||
@@ -110,3 +111,6 @@ onClick() { | ||
type="danger" | ||
onCancel={() => console.log('您点击了取消按钮!')} | ||
onCancel={() => { | ||
clearTimeout(this.time) | ||
console.log('您点击了取消按钮!') | ||
}} | ||
onClosed={this.onClosed.bind(this)} | ||
@@ -118,3 +122,3 @@ onConfirm={() => { | ||
console.log('测试,随机值大于 0.5 执行 resolve 事件,否则 执行 reject 触发 catch 错误', random, random > 0.5) | ||
setTimeout(random > 0.5 ? resolve : reject, 3000); | ||
this.time = setTimeout(random > 0.5 ? resolve : reject, 3000); | ||
}).catch(() => { | ||
@@ -121,0 +125,0 @@ // 可以通过下面方式,阻止弹框消失 |
55130
349
Updated@uiw/react-button@^4.18.1
Updated@uiw/react-icon@^4.18.1
Updated@uiw/react-overlay@^4.18.1
Updated@uiw/utils@^4.18.1