我使用Laravel和Vue.js创建应用程序,最初我的应用程序在创建一个更多组件,遵循了同样的程序等,数据停止被于上表中,我开始Laravel 5.1和Vue.js - 21678未捕获(承诺中)TypeError:无法读取null的属性'data'
fetchUser: function(page) {
var _this2 = this;
this.$http.get('http://localhost:8000/api/v1/users?page='+page).then((response) => {
_this2.$set('users', response.data.data);
_this2.$set('pagination', response.data);
}, (response) => {
console.log("Ocorreu um erro na operação");
});
},
得到以下错误“main.js:21678未捕获的(在承诺)TypeError:无法读取null的属性'data',其中所有内容都表示它位于main.js f如果有人知道发生了什么,请帮助我。接下来我介绍负责错误的函数的代码。
当我运行“的console.log(响应)”作为下列图像将显示在结果: console.log(response)
请帮助我,因为我想继续使用Laravel和Vue.js.这一动态
响应数据作为正文返回,而不是数据。你能显示正在生成数据的后端代码吗? – Ben