PrimeNG Quill编辑器自定义工具栏

ana*_*477 10 quill primeng angular

我想用PrimeNG制作一个quill编辑器的自定义工具栏.我正在使用Angular 2.

这是我在html代码中所做的:

    <p-editor [(ngModel)]="message" [style]="{'height':'320px'}">
        <p-header>
          <span class="ql-formats">
            <select class="ql-size">
              <option value="small">Petit</option>
              <option selected></option>
              <option value="large">Sous-titre</option>
              <option value="huge">Titre</option>
            </select>
          </span>
          <span class="ql-formats">
            <button class="ql-bold" aria-label="Bold"></button>
            <button class="ql-italic" aria-label="Italic"></button>
            <button class="ql-underline" aria-label="Underline"></button>
            <button class="ql-strike" aria-label="Strike"></button>
          </span>
          <span class="ql-formats">
            <select title="Text Color" class="ql-color" defaultValue="rgb(0, 0, 0)">
              <option value="rgb(0, 0, 0)" label="rgb(0, 0, 0)"></option>
              ...
              <option value="rgb(61, 20, 102)" label="rgb(61, 20, 102)"></option>
            </select>
            <span class="ql-format-separator"></span>
            <select title="Background Color" class="ql-background" defaultValue="rgb(255, 255, 255)">
              <option value="rgb(0, 0, 0)" label="rgb(0, 0, 0)"></option>
              ...
              <option value="rgb(61, 20, 102)" label="rgb(61, 20, 102)"></option>
            </select>
        </span>
          <span class="ql-formats">
            <button class="ql-list" title="List"></button>
            <button class="ql-bullet" title="Bullet"></button>
            <select title="Text Alignment" class="ql-align" >
              <option selected>Gauche</option>
              <option value="center" label="Center"></option>
              <option value="right" label="Right"></option>
              <option value="justify" label="Justify"></option>
            </select>            
          </span> 
          <span class="ql-formats">
            <button aria-label="Link" class="ql-link"></button>
            <button aria-label="Image" class="ql-image"></button>
          </span>
        </p-header>
      </p-editor>
Run Code Online (Sandbox Code Playgroud)

这是它的样子 在此输入图像描述

但正如你所看到的那样ql-list,ql-bullet并没有显示出来.

我能做什么 ?

小智 8

注意这两个按钮的代码之间的区别:

 <button class="ql-list" title="List"></button>
 <button class="ql-bullet" title="Bullet"></button>
Run Code Online (Sandbox Code Playgroud)

以及编辑器渲染时的实际代码.您所要做的就是替换将执行此操作的value属性的title属性:

<button class="ql-list" value="ordered"></button>
<button class="ql-list" value="bullet"></button>
Run Code Online (Sandbox Code Playgroud)

我所做的就是回到primeng所具有的完整功能工具栏,并右键单击>检查未正确显示的按钮的html标签,我得到了正确的代码来显示它.