【发布时间】:2020-12-16 08:49:10
【问题描述】:
我的部分代码是这样的,URL 在 for-loop 下。
axios.get(Url).then((response) => { let getJsonAPI = response.data.data.products; if (response.data.data.products.length > 0) { state.jsonGetProductsAPI.push(getJsonAPI); } });
我收到此错误是因为响应不包含 products 属性
只有在“数据”树中有内容时,我才想推送 getJsonAPI。代码按预期工作,但有一个错误,我的强迫症不允许我继续该项目:(有什么想法吗?我是这个东西的新手
【问题讨论】: