我有这样的数据:

逻辑
返回的数据有名为links
closures
closures。代码
axios.post('/api/valChanger', {[val]: e})
.then(res => {
this.closures = res.data.data.links.closures;
})
.catch(error => {
//...
});有什么想法吗?
发布于 2020-05-04 06:04:54
在这种情况下使用rest操作符:
axios.post('/api/valChanger', {[val]: e})
.then(res => {
let links = res.data.links;
for(let i = 0; i < links.length; i++){
this.closures = [...this.closures, ...links[i].closures]
}
})
.catch(error => {
//...
});https://stackoverflow.com/questions/61586004
复制相似问题