我在使用suneditor-react插件时出现错误。我像这样导入suneditor:
import "suneditor/dist/css/suneditor.min.css"; // Import Sun Editor's CSS File
//
const SunEditor = dynamic(() => import("suneditor-react"), {
ssr: false,
});
//
const plugins = dynamic(() => import("suneditor/src/plugins"), {
ssr: false,
});
我使用sundEditor是这样的:编辑器工作正常,但插件不行。
const getSunEditorInstance = (sunEditor) => {
editor.current = sunEditor;
};
<SunEditor
getSunEditorInstance={getSunEditorInstance}
lang="en"
placeholder="Please type here..."
autoFocus={true}
setOptions={{
height: "80vh",
code: "en",
buttonList: [
["undo", "redo"],
[
"bold",
"italic",
"underline",
"strike",
"subscript",
"superscript",
"fontColor",
"hiliteColor",
"align",
"outdent",
"indent",
"list",
"removeFormat",
],
["image", "table"],
["showBlocks", "codeView"],
],
plugins: plugins
}}
setDefaultStyle="font-family: cursive; font-size:16px;"
disable={loading}
onChange={handleChange}
handleImageUploadBefore={handleImageUploadBefore}
onImageUpload={handleImageUpload}
setContents={content}
setAllPlugins={true}
/>
错误:当我点击任何插件像图片上传选项:see error screenshot here
2条答案
按热度按时间kokeuurv1#
pnwntuvh2#
使用类似的东西: