声明: 转载请注明出处
简介: react-quill是一款使用简单易上手,又具备基本需求的编辑器
简单使用示例:
<link rel="stylesheet" href="//cdn.quilljs.com/1.2.6/quill.snow.css">
----------------------------------------------------------------------------
import { Component } from 'react';
import ReactQuill from 'react-quill';
class TextArea extends Component {
constructor(props) {
super(props);
this.state = { text: '' };
this.handleChange = this.handleChange.bind(this);
}
handleChange(value) {
this.setState({ text: value });
}
render() {
return (
<ReactQuill
theme="snow"
value={this.state.text}
onChange={this.handleChange}
/>
);
}
}
export default TextArea;