过滤数据慢,添加loading效果

This commit is contained in:
shijingjing
2023-02-28 14:58:47 +08:00
parent e9574cf236
commit 282dc52148
2 changed files with 20 additions and 3 deletions

View File

@@ -55,12 +55,17 @@ export default {
},
methods: {
getAllGrids() {
uni.showLoading({title: '加载中'})
this.$http.post('/app/appgirdinfo/listByInfo').then((res) => {
if (res?.data) {
let parents = res.data.map(e => e.parentGirdId)
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id)}))
this.gridInit()
}
}).then(()=> {
uni.hideLoading()
}).finally(()=> {
uni.hideLoading()
})
},
gridInit() {