This commit is contained in:
zhuzichu
2023-09-14 18:50:36 +08:00
parent af74f35e43
commit c47fa5ebc7
3 changed files with 186 additions and 0 deletions

View File

@ -48,6 +48,25 @@ FluScrollablePage {
return [tree_view.createItem(randomCompany(), true, subtrees)].concat(createOrg(numLevels - 1, numSubtrees, numEmployees))
}
function treeData(){
const dig = (path = '0', level = 4) => {
const list = [];
for (let i = 0; i < 10; i += 1) {
const key = `${path}-${i}`;
const treeNode = {
title: key,
key,
};
if (level > 0) {
treeNode.children = dig(key, level - 1);
}
list.push(treeNode);
}
return list;
};
return dig();
}
FluArea{
id:layout_actions
Layout.fillWidth: true
@ -132,6 +151,19 @@ FluScrollablePage {
updateData(org)
}
}
FluTreeView2{
id:tree_view_2
width:240
anchors{
top:parent.top
bottom:parent.bottom
}
x:260
Component.onCompleted: {
var data = treeData()
dataSource = data
}
}
}
CodeExpander{