LoadingView.ets 653 B

123456789101112131415161718192021222324252627282930
  1. @Preview
  2. @Component
  3. export struct LoadingView {
  4. @Link isLoading: boolean
  5. @Builder
  6. doNothingBuilder() {
  7. }
  8. @BuilderParam customBuilderParam: () => void = this.doNothingBuilder
  9. build() {
  10. Stack() {
  11. this.customBuilderParam()
  12. Column() {
  13. LoadingProgress()
  14. .color(Color.White)
  15. .width(80).height(80)
  16. Text('努力加载中..')
  17. .fontSize(16)
  18. .fontColor(Color.White)
  19. }
  20. .visibility(this.isLoading ? Visibility.Visible : Visibility.None)
  21. .width('100%')
  22. .height('100%')
  23. .backgroundColor('#40000000')
  24. .justifyContent(FlexAlign.Center)
  25. }
  26. }
  27. }