用法很简答
import ReactQuill from 'react-quill'; // ES6 import * as ReactQuill from 'react-quill'; // Typescript const ReactQuill = require('react-quill'); // CommonJS
class MyComponent extends React.Component { constructor(props) { super(props) this.state = { text: '' } // You can also pass a Quill Delta here this.handleChange = this.handleChange.bind(this) } handleChange(value) { this.setState({ text: value }) } render() { return ( <ReactQuill value={this.state.text} onChange={this.handleChange} /> ) } }
PREVIOUS:
NEXT: