for (var key in arr) {
if (arr.hasOwnProperty(key)) {
console.log('这一次可以输出key'+key)
this.$http.post('/getPaperListByCIdAndTId', {
teacherId: window._const.teacherId,
}).then((res_in) => {
console.log('这一次不能输出key'+key)
})
}
}
第二次输出的是$remove

或者告诉我怎样在.then里获取到key
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
关键字:闭包
用array.map解决会更优雅
闭包了 es6中将var换成let即可