需要在异步调用接口前,先打开新窗口;

在接口返回后,如果确定需要打开新窗口,则设置窗口的 href  地址;

如果不需要,则关闭窗口即可。

 

如:


let newWin = window.open('')
this.singleVisit(url, function (toUrl) {
if (toUrl) {
newWin.location.href = toUrl
}
}, function () {
newWin.close()
})





这样能解决问题。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
  • 2021-07-13
  • 2022-01-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-02-08
  • 2021-07-24
  • 2021-08-06
  • 2022-12-23
相关资源
相似解决方案