1

我将@kolkov/angular-editor 1.2.0 与Angular 11.2.3 一起使用,当我单击编辑器上的按钮项目符号和编号时没有发生任何事情。控制台上没有错误。

这是我使用@kolkov/angular-editor 的代码:

<div class="pr-2">
  <angular-editor
    *ngIf="isDisplay; else rawContent"
    [(ngModel)]="content"
    [config]="editorConfig"
  ></angular-editor>
</div>
<ng-template #rawContent>
  <div class="content-container">
    <div
      class="content-wrapper"
      [innerHTML]="content ? content : 'Enter description here'"
      (click)="onStartEdit()"
    ></div>
  </div>
</ng-template>

我的 editorConfig 对象:

export const editorConfig: AngularEditorConfig = {
  editable: true,
  spellcheck: true,
  height: 'auto',
  minHeight: '120px',
  maxHeight: 'auto',
  width: 'auto',
  minWidth: '480px',
  translate: 'yes',
  enableToolbar: true,
  showToolbar: false,
  placeholder: 'Enter text here...',
  defaultParagraphSeparator: '',
  defaultFontName: '',
  defaultFontSize: '',
  fonts: [
    { class: 'arial', name: 'Arial' },
    { class: 'times-new-roman', name: 'Times New Roman' },
    { class: 'calibri', name: 'Calibri' },
    { class: 'comic-sans-ms', name: 'Comic Sans MS' }
  ],
  sanitize: false,
  toolbarPosition: 'top',
  toolbarHiddenButtons: [
    ['subscript', 'superscript', 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
    ['fontSize']
  ]
};
4

0 回答 0