在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ 報(bào)錯(cuò)Cannot read property 'length' of undef

報(bào)錯(cuò)Cannot read property 'length' of undefined ?

報(bào)錯(cuò)如下:
Uncaught TypeError: Cannot read property 'length' of undefined
請(qǐng)問(wèn)是哪里出問(wèn)題了, 該怎么解決, 謝謝
html


  changeIndex (index){
    console.log(index)
    this.activeIndex = index
    this.sportDatabaseOrderBy = this.sportDatabase.slice(0) // 數(shù)組深拷貝
    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
    }
  }
回答
編輯回答
深記你

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

2017年4月25日 20:29
編輯回答
淺時(shí)光

在for loop時(shí), this.sportDatabaseOrderBy是undefined.

2017年8月5日 18:17
編輯回答
尐飯團(tuán)

在這鐘報(bào)length錯(cuò)誤的情況下,一般都是這個(gè)值是undefined,或是特殊情況下取不到

2018年9月3日 06:11
編輯回答
萌吟

檢查this.sportDatabaseOrderBy是否有值

2018年6月19日 19:22