0

我使用 ngx-quill 并尝试将新编辑器的默认格式设置为粗体

onEditorCreated(quill) {
    quill.format('color', 'red');
    quill.format('align', 'right');
}

然而,这些工作

onEditorCreated(quill) {
    quill.format('bold');
    quill.format('bold', 'bold');
    quill.format('format', 'bold');
    quill.format('inline', 'bold');
    );
  }

这些不。

文档:https ://quilljs.com/docs/api/#formatting

4

1 回答 1

1
onEditorCreated(quill) {
    quill.format('bold','true');
    );
  }

pffff....刚刚发现,从这里得到提示:

https://quilljs.com/docs/api/#updatecontents

.retain(1, { 粗体:真 })

还要感谢https://github.com/KillerCodeMonkey将我推向正确的方向:

https://github.com/KillerCodeMonkey/ngx-quill/issues/971

于 2020-07-17T13:59:28.533 回答