Javascript TypedJs批量键入效果不起作用

Javascript TypedJs批量键入效果不起作用,javascript,html,Javascript,Html,我会像在页面末尾那样进行批量打字 export class AProposComponent implements OnInit { @ViewChild('text', { read: ElementRef }) text: ElementRef constructor() {} ngOnInit() { let textEl = this.text.nativeElement let typed = new Typed(textEl, { strin

我会像在页面末尾那样进行批量打字

export class AProposComponent implements OnInit {
  @ViewChild('text', { read: ElementRef }) text: ElementRef
  constructor() {}

  ngOnInit() {
    let textEl = this.text.nativeElement
    let typed = new Typed(textEl, {
      strings: ['npm install...^1000<br> `installing components...` ^1000 <br> `Fetching from source...`'],
      typeSpeed: 40,
      backSpeed: 0,
      loop: true
    })
  }
}

如何使用Typesjs实现批量打印效果?

您的示例应该可以正常工作

使用
\n
和css样式
空白:pre
而不是

,以避免闪烁效果


看,对我来说,它的工作方式与typedjs示例中的工作方式相同

谢谢,我还将package.json更新为lastest typed.js,现在它可以工作了
npm install...
`installing components...`
`Fetching from source...`