有没有帮解决一下Uncaught TypeError: Cannot read properties of undefined (reading'length') at dd.js:74
你的这个food.contacts这个时候不是个数组,你在遍历之前最好先做一下判断,不是数组的话不要进行遍历,避免影响下面的代码无法执行。
food.contacts为null了吧,你打印一下
food.contacts没数据