亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

報錯Cannot read property 'length' of undefined ?

報錯Cannot read property 'length' of undefined ?

慕標琳琳 2019-03-07 10:27:53
報錯如下:Uncaught TypeError: Cannot read property 'length' of undefined請問是哪里出問題了, 該怎么解決, 謝謝html  changeIndex (index){    console.log(index)    this.activeIndex = index    this.sportDatabaseOrderBy = this.sportDatabase.slice(0) // 數組深拷貝    for (let i = 0; i < this.sportDatabaseOrderBy.length; i++) {       let firstLetter = py.getFullChars(this.sportDatabaseOrderBy[i].name).slice(0,1)       this.sportDatabaseOrderBy[i].firstLetter = firstLetter    }  }
查看完整描述

3 回答

?
慕尼黑的夜晚無繁華

TA貢獻1864條經驗 獲得超6個贊

在for loop時, this.sportDatabaseOrderBy是undefined.


查看完整回答
反對 回復 2019-03-12
?
心有法竹

TA貢獻1866條經驗 獲得超5個贊

檢查this.sportDatabaseOrderBy是否有值


查看完整回答
反對 回復 2019-03-12
?
繁星淼淼

TA貢獻1775條經驗 獲得超11個贊

你的this.sportDatabaseOrderBy是underfined,你檢查下this.sportDatabase


查看完整回答
反對 回復 2019-03-12
  • 3 回答
  • 0 關注
  • 2002 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號