简体   繁体   中英

Opening link in new tab from Polymer Modal

Hi just a very simple question. I have a Modal in my Polymer 3 page. 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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