离子5 window.open不适用于仅iOS的Android

问题描述

我有一个下载pdf的管道。在android上,它可以完美运行,但在ios上却不能。 它不显示错误或警告,只是不起作用。

在这里管道:

transform(value: any,args?: any): any {
    if(value == undefined) return;
    var el = document.createElement("ion-button");
    el.setAttribute('color','danger');
    el.setAttribute('type','submit');
    el.setAttribute('expand','full');
    el.setAttribute('style','margin-bottom: -32px!important;')
    el.innerHTML = "Scarica PDF";
    el.setAttribute('onclick','window.open("' + this.api$.downloadFileUrl(value) + '","_system","location=yes,enableViewportScale=yes,hidden=no")');
    return this.sanitizer.bypassSecurityTrustHtml(el.outerHTML);
  }

value只是文件名,该函数将构建url

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)