在methods中的方法
async getPro () { let _this = this let newArr = [] await axios.get(`api/v1/dailyProTbms`, {checkToken: true}).then(async function(res){ if (res.success && res.data.length > 0) { let arr = res.data for (let i in arr) { arr[i]['centerComment'] = '' arr[i]['checked'] = true for (let j in arr[i].tbms) { const _id = arr[i].tbms[j]._id arr[i].tbms[j]['dailyInfo'] = await _this.getData(_id) // getData是另一个axios请求 } if (+i === arr.length - 1) { _this.spinShowTop = false } } _this.projects = arr } }) this.setTotalInfo() },
不知道为什么重点的地方上不了色了