【问题标题】:Image SPFx control with Hyperlink and OnClick带有超链接和 OnClick 的图像 SPFx 控件
【发布时间】:2021-09-06 23:49:49
【问题描述】:

有许多 Carousel 实现示例,我使用 PnP 中的示例实现了带有 Fluent UI Image 控件的 React 光滑滑块。我需要将 URL 添加到滑块中的图像,这会将用户带到目标 OnClick。 Image Fluent UI 控件没有此方法,我正在寻找在 SPFx 中实现该方法的建议。

提前致谢。

【问题讨论】:

    标签: reactjs spfx fluent-ui


    【解决方案1】:

    你试过了吗? https://pnp.github.io/sp-dev-fx-controls-react/controls/Carousel.html

    这个轮播项目的反应组件具有属性:

    url:    string  - URL to be opened when clicking on details
    target: "_blank" | "_self"  - Target of the URL to open. Default "_blank"
    

    此外,旋转木马具有属性:

    onSelect    (selectedIndex: number) => void Callback function called when element has been selected in the carousel
    

    调用 onSelect 后,您可以使用图像的 url 触发打开新选项卡。

    【讨论】:

      猜你喜欢
      • 2012-07-06
      • 2013-02-10
      • 2012-09-24
      • 2013-05-07
      • 2019-04-16
      • 2013-04-06
      • 1970-01-01
      • 2020-05-30
      • 1970-01-01
      相关资源
      最近更新 更多