easy3wui 1.5.64-beta.3 → 1.5.64-beta.5
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.
|
@@ -27,15 +27,20 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd
|
|
|
27
27
|
var Easy3wRCView = function (_PureComponent) {
|
|
28
28
|
(0, _inherits3['default'])(Easy3wRCView, _PureComponent);
|
|
29
29
|
|
|
30
|
-
function Easy3wRCView() {
|
|
30
|
+
function Easy3wRCView(props) {
|
|
31
31
|
(0, _classCallCheck3['default'])(this, Easy3wRCView);
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
var _this = (0, _possibleConstructorReturn3['default'])(this, _PureComponent.call(this, props));
|
|
34
|
+
|
|
35
|
+
_this.viewerRef = _react2['default'].createRef(); // 创建 ref
|
|
36
|
+
return _this;
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
Easy3wRCView.prototype.componentDidUpdate = function componentDidUpdate() {
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
var viewer = this.viewerRef.current; // 使用 ref 的 current 属性
|
|
41
|
+
if (viewer) {
|
|
42
|
+
viewer.show();
|
|
43
|
+
}
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
Easy3wRCView.prototype.render = function render() {
|
|
@@ -52,6 +57,7 @@ var Easy3wRCView = function (_PureComponent) {
|
|
|
52
57
|
}
|
|
53
58
|
// eslint-disable-next-line react/no-string-refs
|
|
54
59
|
// ref="viewer"
|
|
60
|
+
, ref: this.viewerRef // 使用回调 ref 或 createRef
|
|
55
61
|
},
|
|
56
62
|
_react2['default'].createElement('img', { style: { display: 'none' }, src: imgUrl, alt: '' })
|
|
57
63
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy3wui",
|
|
3
|
-
"version": "1.5.64-beta.
|
|
3
|
+
"version": "1.5.64-beta.5",
|
|
4
4
|
"description": "easy3wui components for react",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
"rc-test": "^6.0.8",
|
|
86
86
|
"rc-tools": "^7.0.2",
|
|
87
87
|
"rc-trigger": "^2.2.2",
|
|
88
|
-
"react": "18.
|
|
88
|
+
"react": "^18.1.0",
|
|
89
89
|
"react-container-query": "^0.11.0",
|
|
90
90
|
"react-document-title": "^2.0.3",
|
|
91
|
-
"react-dom": "18.
|
|
91
|
+
"react-dom": "^18.1.0",
|
|
92
92
|
"react-test-renderer": "^16.0.0",
|
|
93
93
|
"redbox-react": "^1.3.2",
|
|
94
94
|
"roadhog": "^2.5.0-beta.4",
|