export function getTotalProcData(vm){
var totalData = ""
vm.$http.get('/monitor_api'+'/total_process_info')
.then(function(response) {
console.log(response.data)
totalData = response.data
})
.catch(function(response) {
console.log(response)
})
return totalData
}http请求确认是通的,为何这里返回totalData是空的呢?
是否then函数不是闭包呢?
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/615/viewspace-3144362/ ,如需转载,请注明出处,否则将追究法律责任。