简体   繁体   English

在Polymer Modal的新标签页中打开链接

[英]Opening link in new tab from Polymer Modal

Hi just a very simple question. 嗨,只是一个非常简单的问题。 I have a Modal in my Polymer 3 page. 我的Polymer 3页面上有一个模态。 I want to add a link in the model and open the link in new Tab, but its not working. 我想在模型中添加一个链接,然后在新选项卡中打开该链接,但是它不起作用。 The link opens in the same window, where the popup is opened? 链接在打开弹出窗口的同一窗口中打开?

 <html> <div class="modal--innerContainer"> <div> <h3>${item.title}</h3> <p>${item.content}</p> <a href="#" target="_blank">Read more</a> </div> <button on-click="${() => this._closeModal()}">Close</button> </div> </html> 

Please try this 请尝试这个

 <html> <div class="modal--innerContainer"> <div> <h3>${item.title}</h3> <p>${item.content}</p> <a target="_blank" rel="noopener noreferrer" href="http://www.google.com">Read More</a> </div> <button on-click="${() => this._closeModal()}">Close</button> </div> </html> 

Try adding this line. 尝试添加此行。 It works! 有用!

<a href="https://upload.wikimedia.org/wikipedia/en/5/5e/Gothiccover.png" target="_blank">Read more</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM