@ticatec/uniface-element 0.3.17 → 0.3.18
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,13 +27,10 @@
|
|
|
27
27
|
try {
|
|
28
28
|
loading = true;
|
|
29
29
|
const loadedChildren = await lazyLoader.load(node);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
node.append({
|
|
33
|
-
...child,
|
|
34
|
-
expand: child.expand ?? false
|
|
35
|
-
});
|
|
30
|
+
for (const childData of loadedChildren) {
|
|
31
|
+
node.append(childData);
|
|
36
32
|
}
|
|
33
|
+
node.expand = true;
|
|
37
34
|
} finally {
|
|
38
35
|
loading = false;
|
|
39
36
|
}
|
|
@@ -50,12 +50,10 @@
|
|
|
50
50
|
if (activeNode.children == null && lazyLoader != null) {
|
|
51
51
|
try {
|
|
52
52
|
const loadedChildren = await lazyLoader.load(activeNode);
|
|
53
|
-
// 通过 append
|
|
54
|
-
for (const
|
|
55
|
-
activeNode.append(
|
|
56
|
-
|
|
57
|
-
expand: child.expand ?? false
|
|
58
|
-
});
|
|
53
|
+
// 通过 append 方法添加子节点,并设置 expand
|
|
54
|
+
for (const childData of loadedChildren) {
|
|
55
|
+
const childNode = activeNode.append(childData);
|
|
56
|
+
childNode.expand = childData.expand ?? false;
|
|
59
57
|
}
|
|
60
58
|
} catch (error) {
|
|
61
59
|
console.error('Failed to load lazy node:', error);
|
|
@@ -5,9 +5,9 @@ export type OnNodeSelectionChange = (node: ITreeNode<any>) => Promise<boolean>;
|
|
|
5
5
|
*/
|
|
6
6
|
export type NodeVisibleFun = (node: ITreeNode<any>) => boolean;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* 加载子节点(返回纯数据对象)
|
|
9
9
|
*/
|
|
10
|
-
export type LoadChildrenFun = (item: ITreeNode<any>) => Promise<Array<
|
|
10
|
+
export type LoadChildrenFun = (item: ITreeNode<any>) => Promise<Array<any>>;
|
|
11
11
|
/**
|
|
12
12
|
* 按需加载树节点的子节点
|
|
13
13
|
*/
|
package/package.json
CHANGED