问题描述
我正在开发一个使用 Editor.js 作为编辑器的 React 应用程序,该页面运行良好。但是当我尝试访问其他页面时,它会给出未处理的拒绝。这很令人困惑,因为我仅将 editorjs 包导入到编辑器页面,但它要求输入 ID 为“element-js”的元素。
这是编辑器配置文件。
const editor = new EditorJS({
holder: 'editorjs',autofocus: true,tools: {
paragraph: {
class: Paragraph,inlinetoolbar: true,config: {
placeholder: 'Write Here....'
},},table: {
class: Table,config: {
rows: 2,cols: 3,header: {
class: Header,/**
* This property will override the common settings
* That means that this tool will have only Marker and Link inline tools
* If 'true',the common settings will be used.
* If 'false' or omitted,the Inline Toolbar wont be shown
*/
inlinetoolbar: true,config: {
placeholder: 'Header'
},shortcut: 'CMD+SHIFT+H'
},delimiter: Delimiter,warning: Warning,list: {
class: List,inlinetoolbar: [
'link','bold'
]
},quote: Quote,checklist: {
class: Checklist,Marker: {
class: Marker,shortcut: 'CMD+SHIFT+M',embed: {
class: Embed,inlinetoolbar: false,config: {
services: {
youtube: true,coub: true
},image: Imagetool,}
});
以及我如何导入:
import EditorJS from '@editorjs/editorjs';
import Header from '@editorjs/header';
import List from '@editorjs/list';
import Checklist from '@editorjs/checklist';
import Embed from '@editorjs/embed';
import Marker from '@editorjs/marker';
import Warning from '@editorjs/warning';
import Quote from '@editorjs/quote';
import Delimiter from '@editorjs/delimiter';
import Imagetool from '@editorjs/image';
import Table from "@editorjs/table";
import Paragraph from "@editorjs/paragraph";
我不知道这里有什么问题。在我看来,这些导入正在全局导入到整个应用中。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)