【发布时间】:2019-03-19 01:35:10
【问题描述】:
我在 vuejs 应用程序中使用 axios http 客户端和这段代码:
axios.get('http://localhost:8081/pets')
.then(response => {
this.pets = response.data;
})
如果服务器返回简单的“应用程序/json”内容,那么一切都很好。 但我想分别为每一行阅读“application/stream+json”。
例如:
axios.get('http://localhost:8081/pets')
.then(response => {
this.pets.push(response.data)
})
但是这段代码(如预期的那样)不起作用。
【问题讨论】: