解决方法:
在 component 中引入 import { DomSanitizer } from "@angular/platform-browser";然后在构造函数中注入 constructor(private sanitizer: DomSanitizer){ }最后将超链接地址url修改为:
import { DomSanitizer } from "@angular/platform-browser";
constructor(private sanitizer: DomSanitizer){ }
let url = this.sanitizer.bypassSecurityTrustUrl(url);再将这处理过的 url 放到相应地方,就可以找开了