- 博客(1)
- 收藏
- 关注
原创 TypeError: Cannot read properties of null (reading ‘map‘)
result是从后端请求到的xx数据,当请求到的数据不为null时,页面正常显示。但是当请求到的result为null时,此时会出现报错:TypeError: Cannot read properties of null (reading ‘map‘)。在 let result2 = JSON.parse(result.data) 后面加上 || [] 即可。
2025-05-20 09:42:50
177
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人