SplitPanel.qml 912 B

1234567891011121314151617181920212223242526272829303132333435
  1. import QtQuick
  2. import QtQuick.Controls
  3. import FluentUI
  4. Item {
  5. // 左边菜单
  6. FluArea{
  7. id: menuArea
  8. anchors.left: parent.left
  9. height: parent.height
  10. width: 200
  11. FluTreeView{
  12. id: menu_tree
  13. anchors.fill: parent
  14. Component.onCompleted: {
  15. var datas = []
  16. datas.push(createItem("Node1",false))
  17. datas.push(createItem("Node2",false))
  18. datas.push(createItem("Node2",true,[createItem("Node2-1",false),createItem("Node2-2",false)]))
  19. updateData(datas)
  20. }
  21. }
  22. }
  23. // 右边内容
  24. FluArea{
  25. anchors.right: parent.right
  26. anchors.rightMargin: 12
  27. anchors.left: menuArea.right
  28. anchors.leftMargin: 12
  29. anchors.top: parent.top
  30. anchors.bottom: parent.bottom
  31. anchors.bottomMargin: 12
  32. }
  33. }