【发布时间】:2018-10-15 13:50:11
【问题描述】:
我正在尝试从 tinyms 编辑器渲染数据,它使用 react js 在控制台中显示未定义。我想使用 react js 将一些内容写入tinyms 编辑器。请帮我解决这个问题..
import React, { Component } from 'react';
import { Editor } from '@tinymce/tinymce-react';
class AddEvent extends Component {
constructor() {
super();
this.state = {
content: '',
};
this.handleChange=this.handleChange.bind(this);
this.handleEditorChange=this.handleEditorChange.bind(this.content);
}
render() {
return (
<form>
<Editor
initialValue="<p>This is the initial content of the editor</p>"
init={{ plugins: 'link image code',
toolbar: 'undo redo | bold italic| alignleft aligncenter alignright | code'
}}
onChange={this.handleEditorChange}
/>
<div className="col-md-3">
<button className="btn btn-block btn-primary btn-lg" type="submit">Save Event</button>
</div>
</form>
【问题讨论】:
标签: reactjs react-redux textarea editor contenteditable