perf(手机端): 资料中心结构树添加loading

This commit is contained in:
zyn
2023-12-01 16:51:28 +08:00
parent c44ba54cc7
commit 7575cbbfae
2 changed files with 8 additions and 2 deletions
@@ -4,7 +4,8 @@
:style="{ height: '100%', width: '90%' }" :style="{ height: '100%', width: '90%' }"
round round
:close-on-click-overlay="false" :close-on-click-overlay="false"
@click-overlay="handleCancel"> @click-overlay="handleCancel"
get-container="body">
<h3 class="popup-title"> <h3 class="popup-title">
<span>体系结构</span> <span>体系结构</span>
<van-icon name="cross" size="22px" @click="handleCancel" /> <van-icon name="cross" size="22px" @click="handleCancel" />
@@ -18,6 +18,7 @@
<span style="font-size:18px"> {{ node.label }} </span> <span style="font-size:18px"> {{ node.label }} </span>
</span> </span>
</el-tree> </el-tree>
<loading :loading="loading">加载中...</loading>
</div> </div>
</template> </template>
@@ -31,7 +32,8 @@ export default {
label: 'name', label: 'name',
children: 'children' children: 'children'
}, },
currentKey: '' currentKey: '',
loading: false
} }
}, },
created () { created () {
@@ -39,10 +41,13 @@ export default {
}, },
methods: { methods: {
getTreeData () { getTreeData () {
this.loading = true
this.$http._getData('fileMaterialCenter/zlTree').then(res => { this.$http._getData('fileMaterialCenter/zlTree').then(res => {
if (res.ok && res.data) { if (res.ok && res.data) {
this.treeList = res.data this.treeList = res.data
} }
}).finally(() => {
this.loading = false
}) })
}, },
filterNode (value, data) { filterNode (value, data) {