easy3wui 1.5.61 → 1.5.62-beta1

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.
@@ -53,16 +53,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd
53
53
  var Easy3wModal = function (_Component) {
54
54
  (0, _inherits3['default'])(Easy3wModal, _Component);
55
55
 
56
- function Easy3wModal() {
57
- var _temp, _this, _ret;
58
-
56
+ function Easy3wModal(props) {
59
57
  (0, _classCallCheck3['default'])(this, Easy3wModal);
60
58
 
61
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
62
- args[_key] = arguments[_key];
63
- }
59
+ var _this = (0, _possibleConstructorReturn3['default'])(this, _Component.call(this, props));
64
60
 
65
- return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onClickFunc = function (e, func) {
61
+ _this.onClickFunc = function (e, func) {
66
62
  var globalLoading = _this.props.loadingFlag.global;
67
63
  if (globalLoading) {
68
64
  _notification3['default'].warning({
@@ -73,7 +69,9 @@ var Easy3wModal = function (_Component) {
73
69
  } else {
74
70
  func(e);
75
71
  }
76
- }, _this.getOneBtnObj = function (obj) {
72
+ };
73
+
74
+ _this.getOneBtnObj = function (obj) {
77
75
  return _react2['default'].createElement(
78
76
  _button2['default'],
79
77
  {
@@ -86,7 +84,9 @@ var Easy3wModal = function (_Component) {
86
84
  },
87
85
  obj.cName
88
86
  );
89
- }, _this.getBtnObj = function () {
87
+ };
88
+
89
+ _this.getBtnObj = function () {
90
90
  var footBtnArr = _this.props.footBtnArr;
91
91
 
92
92
  var allBtn = footBtnArr.map(function (btn) {
@@ -97,10 +97,22 @@ var Easy3wModal = function (_Component) {
97
97
  { style: { textAlign: 'center' } },
98
98
  allBtn
99
99
  );
100
- }, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
100
+ };
101
+
102
+ _this.timer = null; // 初始化定时器变量
103
+ return _this;
101
104
  }
102
105
 
106
+ Easy3wModal.prototype.componentWillUnmount = function componentWillUnmount() {
107
+ // 组件卸载时清除定时器
108
+ if (this.timer) {
109
+ clearTimeout(this.timer);
110
+ }
111
+ };
112
+
103
113
  Easy3wModal.prototype.render = function render() {
114
+ var _this2 = this;
115
+
104
116
  var _props = this.props,
105
117
  title = _props.title,
106
118
  children = _props.children,
@@ -126,7 +138,10 @@ var Easy3wModal = function (_Component) {
126
138
  style: { top: 20 }
127
139
  }, this.props, {
128
140
  afterClose: function afterClose() {
129
- document.body.style.overflow = '';
141
+ _this2.timer = setTimeout(function () {
142
+ document.body.style.overflow = '';
143
+ _this2.timer = null; // 清除定时器引用
144
+ }, 1);
130
145
  }
131
146
  }),
132
147
  children
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wui",
3
- "version": "1.5.61",
3
+ "version": "1.5.62-beta1",
4
4
  "description": "easy3wui components for react",
5
5
  "keywords": [
6
6
  "react",