Comparing version 1.1.0 to 1.1.1
12
index.js
@@ -69,11 +69,11 @@ 'use strict'; | ||
// 对外暴露该方法,给用户调用 | ||
Dialog.prototype.destroy = function() { | ||
this.setState({ | ||
visible: false | ||
}); | ||
this.unmountDialog(); | ||
} | ||
Dialog.prototype._onCancel = function onCancel(e) { | ||
this.props.onCancel.call(this); | ||
this.setState({ | ||
visible: false | ||
}); | ||
this.destroy(); | ||
@@ -93,3 +93,3 @@ }; | ||
comp = this; | ||
dialog.addEventListener(_getTransitionEnd2.default, function () { | ||
dialog && dialog.addEventListener(_getTransitionEnd2.default, function () { | ||
_reactDom2.default.unmountComponentAtNode(document.getElementById(conid)); | ||
@@ -103,3 +103,3 @@ callback && callback.call(comp); | ||
var dialog = _reactDom2.default.findDOMNode(this.refs.dialog); | ||
setTimeout(function () { | ||
dialog && setTimeout(function () { | ||
comp.setState({ | ||
@@ -106,0 +106,0 @@ dialogMarginTop: -Math.round(dialog.clientHeight / 2) + 'px', |
{ | ||
"name": "m-dialog", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "m-dialog 移动端模态对话框", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -39,7 +39,9 @@ # m-dialog | ||
- `Dialog.alert` | ||
- `Dialog.confirm` | ||
- `const obj = Dialog.alert` | ||
- `const obj = Dialog.confirm` | ||
以上均为一个函数,参数为 object,具体属性上 | ||
```obj```为对象实例,可以直接调用```obj.destroy()```关闭对话框 | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28380
169
47