Open image in new tab in spfx webpart
-
08-02-2021 - |
質問
I want to open image in new tab if some one click on legend "Click here".
<p className="legends"><FieldUrlRenderer text={'Click here'} url={imageList.Image ? imageList.Image["Url"] :''} className="Videolegends" /></p>
Currently it is opening in same window if I click on link.
解決
Try following workarounds:
- Using window.open():
window.open(imageUrl, '_blank');
Using Anchor tag / hyperlink:
- Add your image somewhere in SharePoint library/picture gallery
- Add anchor tag (hyperlink) with
target="_blank
attribute and give image path inhref
attribute.
所属していません sharepoint.stackexchange