import React,{Component} from 'react'; import ReactQuill,{ Quill } from 'react-quill'; import 'react-quill/dist/quill.snow.css'; import { Button ,Modal,message} from 'antd'; import MYURL from '../api/config'; import { ImageDrop } from 'quill-image-drop-module'; Quill.register('modules/imageDrop', ImageDrop);
class Editer extends Component { constructor(props) { super(props) this.state = { text: '' } // You can also pass a Quill Delta here this.handleChange = this.handleChange.bind(this) this.selectImage = this.selectImage.bind(this); this.changeImageBeforeUpload = this.changeImageBeforeUpload.bind(this); this.uploadForImage = this.uploadForImage.bind(this); this.imageHandler = this.imageHandler.bind(this); this.showUploadBox = this.showUploadBox.bind(this); this.hideUploadBox =this.hideUploadBox.bind(this); this.handleUpload =this.handleUpload.bind(this); } handleChange(value) { // if (value) ReactQuill.getSelection().dangerouslyPasteHTML(value); this.setState({ text: value }) }; modules={ //富文本配置 toolbar:{ container:[ [{ 'header': [1, 2, 3, 4, 5, 6, false] }], ['bold', 'italic', 'underline', 'strike','blockquote'],
react-quill 富文本编辑器 ---- 图片处理
最新推荐文章于 2025-04-22 09:40:01 发布