Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/407.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Editor.js中将实例限制为一种块样式_Javascript_Editorjs - Fatal编程技术网

Javascript 在Editor.js中将实例限制为一种块样式

Javascript 在Editor.js中将实例限制为一种块样式,javascript,editorjs,Javascript,Editorjs,我正在使用图书馆。 我想在我的编辑页面上有一个只接受标题块的标题部分。这是我用来实现的代码: const titleEditor = new EditorJS({ placeholder: "Enter a title...", holderId: "title-editor", tools: { header: { class: Header, shortcut: "CMD+SHIFT+H", config: { plac

我正在使用图书馆。
我想在我的编辑页面上有一个只接受标题块的标题部分。这是我用来实现的代码:

const titleEditor = new EditorJS({
  placeholder: "Enter a title...",
  holderId: "title-editor",
  tools: {
    header: {
      class: Header,
      shortcut: "CMD+SHIFT+H",
      config: {
        placeholder: "Enter a Header..."
      }
    }
  }
});
现在,这基本上是我想要的。但是,它允许我在编辑器中添加多个标题。也就是说,如果我键入一个标题并点击return,那么我可以得到加号图标,它允许我添加另一个标题——和另一个标题,以此类推

但我不想那样。我想要一个单一的页眉。也就是说,我只想将该块锁定到头块的一个实例


你知道我该怎么做吗?

现在,你可以使用外部文本区域作为标题,使用editor.js作为文章正文

将来,editor.js将支持条目模板,允许您提供文档的持久结构