Angular 鹅毛笔编辑器不会将文本左对齐

标签 angular alignment quill text-alignment

在这里,我尝试将 0-34 范围内的文本(即一行)向左对齐

代码片段:

quill.formatText(0, 34, {
      'color': "White",
      'align': 'left',
      'background-color': "Black"
}, 'api');

预期:

添加上述代码后 - 从索引 0 到长度 34 的文本应在编辑器内向左对齐。

实际结果:

文本保留在中心。

我需要帮助以不同的对齐方式(左/右/中心)对齐文本范围

最佳答案

根据their documentation :

For line level formats, such as text alignment, target the newline character or use the formatLine helper:

quill.formatText(0, 34, {
  'color': "White",
  'background-color': "Black"
}, 'api');

quill.formatLine(0, 1, 'align', 'left');

关于Angular 鹅毛笔编辑器不会将文本左对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62939092/

相关文章:

css - 如何限制DIV在同一行

CSS:何时使用 right: 0px 何时使用 float: 对吗?

javascript - Quill编辑器+VueJS2图片上传: Base64 image to URL

scala - 为什么这个简单的羽毛笔引述无法编译?

Angular 6/7 默认使用 Eager/Lazy 加载?

Angular ngrx-store : How to share store among modules (main module/feature module)

css - 如何使用列表样式对齐?

QuillJS/羊皮纸 : Controlling Nesting Order?

javascript - Angular 2 RC5 编写基于模板的表单的方式是什么?

javascript - HTTP POST 到 Web API 后的 Angular 2+ 确认页面