|
|
|
@ -4,8 +4,9 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2019-12-18 08:49:30
|
|
|
|
|
* @LastEditors: tangjiang
|
|
|
|
|
* @LastEditTime: 2019-12-19 16:58:50
|
|
|
|
|
* @LastEditTime: 2019-12-20 15:55:50
|
|
|
|
|
*/
|
|
|
|
|
import './index.scss';
|
|
|
|
|
import 'quill/dist/quill.core.css'; // 核心样式
|
|
|
|
|
import 'quill/dist/quill.snow.css'; // 有工具栏
|
|
|
|
|
import 'quill/dist/quill.bubble.css'; // 无工具栏
|
|
|
|
@ -65,11 +66,14 @@ function QuillForEditor ({
|
|
|
|
|
},
|
|
|
|
|
readOnly,
|
|
|
|
|
placeholder,
|
|
|
|
|
scrollingContainer: '#editorContainer',
|
|
|
|
|
theme: readOnly ? 'bubble' : 'snow'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const quillNode = document.createElement('div');
|
|
|
|
|
editorRef.current.appendChild(quillNode);
|
|
|
|
|
const _quill = new Quill(editorRef.current, quillOption);
|
|
|
|
|
setQuill(_quill);
|
|
|
|
|
|
|
|
|
@ -157,9 +161,9 @@ function QuillForEditor ({
|
|
|
|
|
|
|
|
|
|
// 返回结果
|
|
|
|
|
return (
|
|
|
|
|
<div className='quill_editor_for_react_area' style={wrapStyle}>
|
|
|
|
|
<div ref={editorRef} style={style}></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="editorContainer" className='quill_editor_for_react_area' style={wrapStyle}>
|
|
|
|
|
<div ref={editorRef} style={style}></div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|