Javascript React Draft.js中的图像显示问题
我正在我的一个项目中使用react draftjs。然而,当我尝试通过url添加图像时,图像会显示出来,但当我保存它并将信息发送到服务器,然后再获取它时,我并没有得到任何图像。它只是一个空的数字标签 我国:Javascript React Draft.js中的图像显示问题,javascript,reactjs,draftjs,react-draft-wysiwyg,Javascript,Reactjs,Draftjs,React Draft Wysiwyg,我正在我的一个项目中使用react draftjs。然而,当我尝试通过url添加图像时,图像会显示出来,但当我保存它并将信息发送到服务器,然后再获取它时,我并没有得到任何图像。它只是一个空的数字标签 我国: const [editorState, setEditorState] = useState(() => EditorState.createEmpty() ); const [convertedContent, setConvertedContent] = useState
const [editorState, setEditorState] = useState(() =>
EditorState.createEmpty()
);
const [convertedContent, setConvertedContent] = useState(null);
const handleEditorChange = (state) => {
setEditorState(state);
convertContentToHTML();
};
const convertContentToHTML = () => {
let currentContentAsHTML = convertToHTML(editorState.getCurrentContent());
setConvertedContent(currentContentAsHTML);
};
我的编辑公司:
<Editor
editorState={editorState}
onEditorStateChange={handleEditorChange}
wrapperClassName="wrapper-class"
editorClassName="editor-class"
toolbarClassName="toolbar-class"
placeholder="Type something here..."
toolbar={{
inline: { inDropdown: false },
list: { inDropdown: true },
textAlign: { inDropdown: false },
link: { inDropdown: true },
history: { inDropdown: false },
}}
/>