You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Framework7框架中<a>标签跳转失效问题求助

Hey there, let's get that link working properly! Looking at your code, there are a few syntax and configuration issues that are causing the problem. Here's what's wrong and how to fix it:

1. Correct Variable & Constructor Names

  • JavaScript variable declarations use lowercase var (not Var)
  • The Framework7 constructor is Framework7, not Framework — that's the official name of the framework's core initializer.

2. Fix Route Configuration Key

Framework7 expects routing settings under the lowercase routes property (not Route), and it needs to be an array of route objects. This is a case-sensitive configuration key the framework looks for to map paths to pages.

Your link should match the exact path defined in your route. Change <a href="page1" class="link">link1</a> to <a href="/page1" class="link">link1</a> — adding the leading slash ensures the router recognizes it as a top-level route path.

Corrected Full Code

var app = new Framework7({
  routes: [
    {
      path: '/page1',
      url: 'page/page1.html'
    }
  ]
});

Quick Bonus Check

Double-check that your page/page1.html file exists in the correct directory relative to your main app file, and that it follows Framework7's page structure (it should have a <div class="page"> wrapper as the root element of the page content).

内容的提问来源于stack exchange,提问作者Sagar Shinde

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:09:51