py-test-component 1.0.8 → 1.0.10
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/dist/py-component.esm.js +1 -1
- package/dist/py-component.js +1 -1
- package/package.json +1 -1
- package/src/react/index.js +4 -3
package/package.json
CHANGED
package/src/react/index.js
CHANGED
|
@@ -22,13 +22,14 @@ let isLoaded = false;
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* 加载组件库核心逻辑
|
|
25
|
-
*
|
|
25
|
+
* 动态加载 UMD 构建产物,避免循环依赖
|
|
26
26
|
*/
|
|
27
27
|
async function doLoad() {
|
|
28
28
|
if (typeof window === 'undefined') return null;
|
|
29
29
|
if (window.PyComponent) return window.PyComponent;
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
// 使用相对路径加载构建产物,支持 Webpack/Vite 等构建工具解析
|
|
32
|
+
const module = await import('../../dist/py-component.esm.js');
|
|
32
33
|
const PyComponent = module.default || module;
|
|
33
34
|
|
|
34
35
|
if (PyComponent && typeof window !== 'undefined') {
|
|
@@ -94,7 +95,7 @@ export const PyTable = forwardRef(function PyTable({ data, loading: propsLoading
|
|
|
94
95
|
|
|
95
96
|
useEffect(() => {
|
|
96
97
|
if (elRef.current && data && loaded) {
|
|
97
|
-
// 直接设置 property
|
|
98
|
+
// 直接设置 property,避免 JSON 序列化/反序列化开销
|
|
98
99
|
elRef.current.tableData = data;
|
|
99
100
|
}
|
|
100
101
|
}, [data, loaded]);
|