From de0151aaae18282e885e5ae2d84653d1131a65a4 Mon Sep 17 00:00:00 2001 From: liuwh <hugeinfo123> Date: Wed, 01 Apr 2020 11:26:42 +0800 Subject: [PATCH] xiufu --- SunshineIns/src/page/ArticleEidt.jsx | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/SunshineIns/src/page/ArticleEidt.jsx b/SunshineIns/src/page/ArticleEidt.jsx index 11c1fd9..cc188ce 100644 --- a/SunshineIns/src/page/ArticleEidt.jsx +++ b/SunshineIns/src/page/ArticleEidt.jsx @@ -174,6 +174,17 @@ xhr.open('POST', serverURL, true) xhr.send(fd) } + handleEditorChange = (editorState) => { + this.setState({ editorState }) + const htmlContent = editorState.toHTML() + console.log(htmlContent) + this.setState(({ savedate }) => ({ + savedate: { + ...savedate, + content: htmlContent + } + })) + } submitContent = () => { // 在编辑器获得焦点时按下ctrl+s会执行此方法 @@ -187,9 +198,6 @@ })) } - handleEditorChange = (editorState) => { - this.setState({ editorState }) - } render() { const { dateSource, show, visible, closeKey, selectedRow, savedate, fileList, editorState } = this.state; @@ -272,7 +280,7 @@ <Col span={18} push={0} style={{ border: 'solid 1px rgba(0, 0, 0, 0.25)', borderRadius: '5PX' }} > <BraftEditor value={editorState} - placeholder='请输入文章内容' + placeholder='请输入活动进程' media={{ allowPasteImage: true, // 是否允许直接粘贴剪贴板图片(例如QQ截图等)到编辑器 image: true, // 开启图片插入功能 -- Gitblit v1.8.0