layuiExtend icon indicating copy to clipboard operation
layuiExtend copied to clipboard

请教eleTree 假如我的子节点的子节点名字不一样,如何读取数据?

Open 986482 opened this issue 6 years ago • 1 comments

比如数据如下: data: [ { id: 1, label: "安徽省", children: [ { id: 2, label: "马鞍山市", disabled: true, children2: [ { id: 3, label: "和县", }, { id: 4, label: "花山区", } ] } ] }, { id: 5, label: "河南省", children: [ { id: 6, label: "郑州市" } ] } ]

我看文档异步数据是可以定义 request: { name: "label", key: "id", children: "children", checked: "checked", disabled: "disabled", isLeaf: "isLeaf" }

但是我的children的子节点名字叫children2,请问如何读取呢

986482 avatar May 22 '19 14:05 986482

@986482 目前暂不支持父子节点键的名字不同的情况,况且如果你的每个节点的键名都不一样,这种情况确实不好办,还是推荐使用一样的名字

hsiangleev avatar May 23 '19 00:05 hsiangleev