T_StatusView.qml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import QtQuick
  2. import QtQuick.Layouts
  3. import QtQuick.Controls
  4. import QtQuick.Window
  5. import FluentUI
  6. import "../component"
  7. FluScrollablePage{
  8. title:"StatusView"
  9. leftPadding:10
  10. rightPadding:10
  11. bottomPadding:20
  12. spacing: 0
  13. FluArea{
  14. id:layout_actions
  15. Layout.fillWidth: true
  16. Layout.topMargin: 20
  17. height: 50
  18. paddings: 10
  19. RowLayout{
  20. spacing: 14
  21. FluDropDownButton{
  22. id:btn_status_mode
  23. Layout.preferredWidth: 140
  24. text:"Loading"
  25. items:[
  26. FluMenuItem{
  27. text:"Loading"
  28. onClicked: {
  29. btn_status_mode.text = text
  30. status_view.statusMode = FluStatusView.Loading
  31. }
  32. },
  33. FluMenuItem{
  34. text:"Empty"
  35. onClicked: {
  36. btn_status_mode.text = text
  37. status_view.statusMode = FluStatusView.Empty
  38. }
  39. },
  40. FluMenuItem{
  41. text:"Error"
  42. onClicked: {
  43. btn_status_mode.text = text
  44. status_view.statusMode = FluStatusView.Error
  45. }
  46. },
  47. FluMenuItem{
  48. text:"Success"
  49. onClicked: {
  50. btn_status_mode.text = text
  51. status_view.statusMode = FluStatusView.Success
  52. }
  53. }
  54. ]
  55. }
  56. }
  57. }
  58. FluArea{
  59. Layout.fillWidth: true
  60. Layout.topMargin: 10
  61. height: 380
  62. paddings: 10
  63. FluStatusView{
  64. id:status_view
  65. anchors.fill: parent
  66. onErrorClicked:{
  67. showError("点击重新加载")
  68. }
  69. Rectangle {
  70. anchors.fill: parent
  71. color:FluTheme.primaryColor.dark
  72. }
  73. }
  74. }
  75. CodeExpander{
  76. Layout.fillWidth: true
  77. Layout.topMargin: -1
  78. code:'FluStatusView{
  79. anchors.fill: parent
  80. statusMode: FluStatusView.Loading
  81. Rectangle{
  82. anchors.fill: parent
  83. color:FluTheme.primaryColor.dark
  84. }
  85. }'
  86. }
  87. }