用react做的微信端頁面,想達到的效果是在頁面加載后input框自動獲得焦點能夠彈出移動端的鍵盤,所以在componentDidMount中觸發input框的focus,但是無效是怎么回事?componentDidMount: function () { var that = this;
React.findDOMNode(this.refs.password).focus();
}
在react的componentDidMount中觸發input框的focus無效是為什么?
蝴蝶不菲
2018-09-14 11:10:18