在 PnP 现代搜索 Web 部件 SPFx 中,我们可以强制在详细列表布局内的弹出窗口中打开链接吗?

问题描述 投票:0回答:1

我的 PnP 现代搜索结果中有以下设置 PnP 现代搜索 (v4):

  1. 我定义使用SharePoint Search,如下: enter image description here

  2. 使用详细列表布局,如下: enter image description here

  3. 在“管理列”部分内: enter image description here

我为一列添加了此公式,以在新选项卡中打开项目详细信息:

<a
  href="{{slot item @root.slots.PreviewUrl}}"
  data-interception="off"
  target="_blank"
  style="color: {{@root.theme.semanticColors.link}}"
>
  {{slot item @root.slots.Destination}}
</a>

目前该链接将在新选项卡中打开,没有任何问题。但是如何强制链接在弹出窗口而不是新选项卡中打开?

javascript reactjs sharepoint-online spfx spfx-extension
1个回答
0
投票

希望你能得到你想要的

 <a 
  href="javascript:void(0);" 
  onclick="window.open('{{slot item @root.slots.PreviewUrl}}', 'popupWindow', 'width=800,height=600,scrollbars=no,resizable=no');" 
  style="color: {{@root.theme.semanticColors.link}}"
>
  {{slot item @root.slots.Destination}}
</a>
© www.soinside.com 2019 - 2024. All rights reserved.