更新时间:2023-02-09 GMT+08:00
分享

app-preview-text组件

HTML

<div>
      <p
        class="preview-element text-element"
        [style]="item.style"
        (click)="PreviewService.emit(item.event)"
        // innerHTML为插入html片段的指令
        [innerHTML]="item.text"
      ></p>
    </div>
})

CSS

.text-element {
  overflow: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  input {
    color: inherit;
    border: 0;
    outline: none;
    background: hsla(0, 0%, 100%, 0);
    padding: 0;
    font-size: inherit;
  }
  input[type='button'],
  input[type='reset'],
  input[type='search'],
  input[type='submit'] {
    -webkit-appearance: none;
    cursor: pointer;
  }
}

JavaScript

// 引入PreviewService,用来触发事件
import { PreviewService } ;

相关文档