在这里,我尝试将 0-34 范围内的文本(即一行)向左对齐
代码片段:
quill.formatText(0, 34, {
'color': "White",
'align': 'left',
'background-color': "Black"
}, 'api');
预期:
添加上述代码后 - 从索引 0 到长度 34 的文本应在编辑器内向左对齐。
实际结果:
文本保留在中心。
我需要帮助以不同的对齐方式(左/右/中心)对齐文本范围
最佳答案
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/