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