原文:Uncaught TypeError: Cannot read property 'trim' of undefined

可以這樣寫,有值的時候trim,沒值的時候為空 let user this.state.name.trim ...

2018-07-02 16:35 0 1740 推薦指數:

查看詳情

Uncaught TypeError: Cannot read property ‘split’ of undefined

問題 :Uncaught TypeError: Cannot read property ‘split’ of undefinedat HTMLLIElement. split()切割的問題 因為遍歷ul的時候,第一次會得到一個空值,這個是通過輸出遍歷的對象知道的,最后我在使用split ...

Sat Apr 27 02:23:00 CST 2019 0 1095
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM