本文介绍了Quill js字体大小问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于 quill.js 的关于字体大小的程序.我添加了一些字体大小

I have a proglem with quill.js regarding the font sizes. I have added some font sizes

<select title={__("Font size")} className="ql-size">
    <option value="8px">8</option>
    <option value="9px">9</option>
    <option value="10px">10</option>
    <option value="11px">11</option>
    <option value="12px">12</option>
    <option value="14px" selected>14</option>
    <option value="18px">18</option>
    <option value="24px">24</option>
    <option value="30px">30</option>
    <option value="36px">36</option>
    <option value="48px">48</option>
    <option value="60px">60</option>
    <option value="72px">72</option>
    <option value="96px">96</option>
</select>

而且我不会写任何大于 18 的东西,这意味着第 7 个索引

And i am not abel to write with anything bigger than 18 , that means the 7th index

此外,我还将添加到库中的默认 FONT_SIZE 变量中:

Also i wull i have added to the default FONT_SIZE variable inside the library:

FONT_SIZES: {
    '8px': 1,
    '9px': 2,
    '10px': 3,
    '11px': 4,
    '12px': 5,
    '14px': 6,
    '18px': 7,
    '24px': 8,
    '30px': 9,
    '36px': 10,
    '48px': 11,
    '60px': 12,
    '72px': 13,
    '96px': 14
  }

有人知道如何解决这个问题吗?

Does anybody know how to fix this?

推荐答案

FONT_SIZE 常量不应更改,而是由于浏览器的限制而设置的.请参阅https:/的fontSize部分/developer.mozilla.org/en-US/docs/Web/API/Document/execCommand.Quill 1.0 不再使用 execCommand,不应该有这个限制.

The FONT_SIZE constant is not meant to be changed and is set due to limitations in the browser. See the fontSize section of https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand. Quill 1.0 is moving away from using execCommand and should not have this limitation.

这篇关于Quill js字体大小问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 04:22