mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 08:05:29 +08:00
update
This commit is contained in:
@ -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{
|
||||
|
Reference in New Issue
Block a user