1
我使用使用tinymce-rails gem for Rails應用程序的ReactJS呈現我的提交表單。其次本教程安裝TinyMCE的:https://github.com/spohlenz/tinymce-railsTinyMCE僅在ReactJS刷新時加載
渲染代碼:
render: function() {
<textarea
ref="body"
value={this.state.data.body}
onChange={this.handleBodyChange}
className="tinymce form-control"
placeholder="Body"
rows="10"
cols="5"
required
/>
}
的問題是,它僅呈現在頁面刷新,沒有它我們有定期的textarea。 Turbolinks被禁用。 試圖將tinymce.init({selector:'textarea'})
添加到componentDidMount:
,但它不起作用。
你的意思是說,它在你最初加載它時工作,但然後停止改變工作? 'this.handleBodyChange'中有什麼? –
http://stackoverflow.com/questions/29169158/react-html-editor-tinymce –
@HannesJohansson當我訪問該頁面時,它沒有加載。我需要刷新頁面到ttrigger tinymce。 –