infoList.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view class="storageList">
  3. <objectAnalysis
  4. v-if="isLoaded"
  5. :data="data"
  6. :isOpenFirst="true"
  7. :width="710"
  8. />
  9. <view
  10. v-else
  11. class="dataLoading"
  12. >
  13. <text class="status">加载中</text>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import objectAnalysis from "./objectAnalysis.vue";
  19. import getRuntimeInfo from "../libs/getRuntimeInfo";
  20. export default {
  21. components: {
  22. objectAnalysis,
  23. },
  24. data() {
  25. return {
  26. /**
  27. * 是否完成加载
  28. */
  29. isLoaded: false,
  30. /**
  31. * 缓存里的数据
  32. */
  33. data: {},
  34. };
  35. },
  36. methods: {
  37. /**
  38. * 加载数据
  39. */
  40. async getData() {
  41. let that = this;
  42. that.isLoaded = false;
  43. let data = await getRuntimeInfo();
  44. setTimeout(() => {
  45. that.data = data;
  46. that.isLoaded = true;
  47. }, 500);
  48. },
  49. },
  50. };
  51. </script>
  52. <style lang="scss" scoped>
  53. .storageList {
  54. padding: 20rpx;
  55. width: 750rpx;
  56. }
  57. .dataLoading {
  58. width: 750rpx;
  59. height: 400rpx;
  60. display: flex;
  61. flex-direction: row;
  62. align-items: center;
  63. justify-content: center;
  64. .status {
  65. font-size: 20rpx;
  66. color: #888;
  67. line-height: 20rpx;
  68. }
  69. }
  70. </style>