@cqsjjb/jjb-cloud-component 0.0.7 → 0.0.8
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/cloud-component.js +7 -5
- package/package.json +1 -1
package/cloud-component.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
2
3
|
|
|
3
|
-
import
|
|
4
|
+
import * as jjbCommonLib from '@cqsjjb/jjb-common-lib';
|
|
4
5
|
|
|
5
6
|
import ImportCloudComponent from './import-cloud-component';
|
|
6
7
|
|
|
@@ -44,9 +45,10 @@ export default function CloudComponent(props) {
|
|
|
44
45
|
|
|
45
46
|
// 默认内置依赖项,所有云组件都可以使用
|
|
46
47
|
const defaultDependencies = {
|
|
47
|
-
'react':
|
|
48
|
-
'react-dom':
|
|
49
|
-
'
|
|
48
|
+
'react': React,
|
|
49
|
+
'react-dom': ReactDOM,
|
|
50
|
+
'jjbCommonLib': jjbCommonLib,
|
|
51
|
+
'@cqsjjb/jjb-common-lib': jjbCommonLib
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
// 合并默认依赖和用户自定义依赖,用户依赖优先级更高
|
|
@@ -157,7 +159,7 @@ export default function CloudComponent(props) {
|
|
|
157
159
|
const stableComponentProps = React.useMemo(() => {
|
|
158
160
|
return {
|
|
159
161
|
detail: { componentKey },
|
|
160
|
-
...tools.toObject(componentProps)
|
|
162
|
+
...jjbCommonLib.tools.toObject(componentProps)
|
|
161
163
|
};
|
|
162
164
|
}, [componentKey, JSON.stringify(componentProps)]);
|
|
163
165
|
|