如何在“新窗口”而不是“新选项卡”中打开Angular routerLinks?
<a
target="_blank"
[routerLink]="['/product/',productData?.productId]"
>
此功能在2020年最新的Chrome浏览器中不起作用(仍在打开标签页中)
答案 0 :(得分:0)
<a onclick="window.open('/product/' + productData?.productId)"></a>
答案 1 :(得分:0)
您可以使用window.open方法来实现。下面是在新窗口中打开链接的示例。
<a href="'/product/' + productData?.productId" target="popup" (click)="window.open('/product/' + productData?.productId,'name','width=600,height=400')">Open page in new window</a>
检查此网站以供参考。 https://www.rapidtables.com/web/html/link/html-link-new-window.html