2016-04-08 18 views

回答

1
<div ref="myDiv"> 
    ... 
</div> 

而且

componentDidUpdate() { 
    var height = this.refs.myDiv.clientHeight; 
} 
+0

遺漏的類型錯誤:無法讀取的未定義的屬性「clientHeight」這eroor我得到 –

+0

你把ref屬性你格設置是否正確? – whitep4nther

+0

感謝兄弟 –

相關問題