vue報錯:"TypeError: Cannot read property 'forEach' of undefined"

在vue項目中有一個表格操作需要「獲取收藏狀態」的方法,其中用到了forEach, 本來還好好的,結果當收藏列表爲空時forEach報錯了:"TypeError: Cannot read property 'forEach' of undefined"  具體代碼如下: //獲取收藏狀態 getSc(items){ // console.log('對比列', this.scExistingA
相關文章
相關標籤/搜索