easy3wui 1.5.64-beta.11 → 1.5.64-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Easy3wModal/index.js +9 -1
- package/package.json +1 -1
package/lib/Easy3wModal/index.js
CHANGED
|
@@ -62,7 +62,7 @@ var Easy3wModal = function (_Component) {
|
|
|
62
62
|
args[_key] = arguments[_key];
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onClickFunc = function (e, func) {
|
|
65
|
+
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.modalRef = (0, _react.createRef)(), _this.onClickFunc = function (e, func) {
|
|
66
66
|
var globalLoading = _this.props.loadingFlag.global;
|
|
67
67
|
if (globalLoading) {
|
|
68
68
|
_notification3['default'].warning({
|
|
@@ -100,6 +100,13 @@ var Easy3wModal = function (_Component) {
|
|
|
100
100
|
}, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
Easy3wModal.prototype.componentWillUnmount = function componentWillUnmount() {
|
|
104
|
+
// 确保在组件卸载后不会尝试访问 DOM 节点
|
|
105
|
+
if (this.modalRef.current) {
|
|
106
|
+
document.body.style.overflow = '';
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
103
110
|
Easy3wModal.prototype.render = function render() {
|
|
104
111
|
var _props = this.props,
|
|
105
112
|
title = _props.title,
|
|
@@ -114,6 +121,7 @@ var Easy3wModal = function (_Component) {
|
|
|
114
121
|
return _react2['default'].createElement(
|
|
115
122
|
_modal2['default'],
|
|
116
123
|
(0, _extends3['default'])({
|
|
124
|
+
ref: this.modalRef,
|
|
117
125
|
title: title,
|
|
118
126
|
visible: visible,
|
|
119
127
|
confirmLoading: loadingFlag,
|