console
cola(function(model){
model.dataType({
name: "Node",
properties: {
nodes: {
dataType: "Node",
provider: {
url: "http://open-data.cola-ui.com/service/district/children",
parameter: {
parentId: "{{@id}}"
}
}
}
}
});
model.action({
getName: function(node) {
return node.get("isDir") ? "文件夹" : "文件"
}
})
model.describe("nodes", {
dataType: "Node",
provider: "http://open-data.cola-ui.com/service/district/provinces"
});
model.widgetConfig({
fileTree: {
bind: {
hasChildProperty: "isDir",
expression: "node in nodes",
textProperty:"name",
child: {
recursive: true,
hasChildProperty: "isDir",
textProperty:"name",
expression: "node in node.nodes"
}
},
height: "100%"
}
});
})
<c-tree id="fileTree"></c-tree>
<br>