Framework7 <a href=""> 不工作

Framework7 <a href=""> not working

我在使用 FrameWork7 的页面中有一个简单的 <a>,如下所示:

<li><a href="https://www.google.com/"><img src="images/icons/black/users.png" alt="" title="" /><span>Go Google/span></a></li>

但是当我点击它时,它并没有重定向到 google 页面。我检查了控制台,它显示如下:

XMLHttpRequest cannot load https://www.google.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
framework7.js:12307 XHR failed loading: GET "https://www.google.com/".$.ajax @ framework7.js:12307app.get @ framework7.js:1652app.router.load @ framework7.js:2648load @ framework7.js:636handleClicks @ framework7.js:7573handleLiveEvent @ framework7.js:11488

我是 Framework7 的新手。我已经购买了开发模板。

你没有关闭跨度,还添加一个目标:

<li><a href="https://www.google.com/" target="_blank"><img src="images/icons/black/users.png" alt="" title="" /><span>Go Google</span></a></li>

正如 docs 所说:

It is possible to bypass F7 link handler (if you want to add custom logic to link, or want it to direct to external website). In this case we need additional external class

<a class="link external" href="http://google.com">Open Google</a>

您希望 link 在您的 Framework7 应用程序之外,因此只需将 external class 添加到您的 a href 并使其正常工作

<li><a href="https://www.google.com/" class="external"><img src="images/icons/black/users.png" alt="" title="" /><span>Go Google</span></a></li>

看到你在写下结束跨度标签时有错别字