代码之家  ›  专栏  ›  技术社区  ›  Master.Deep

nuxt js静态页面相对url

  •  0
  • Master.Deep  · 技术社区  · 7 年前

    我正在使用nuxt.js(mpa)处理一些静态页面。每当我运行 generate 命令,所有 <nuxt-link> URL从根开始,即 / . 例如,我的结构是:

    pages
        |
         - index.vue
         - policy.vue
    

    而在 index.vue 我已将策略页链接为:

    <nuxt-link to="policy.html"> Policy </nuxt-link>
    

    结果是 /policy.html 而不是 policy.html .

    1 回复  |  直到 7 年前
        1
  •  1
  •   CMarzin    7 年前

    你需要替换 policy.html 在这样一条小路上

    错误: <nuxt-link to="policy.html"> Policy </nuxt-link>

    正确的: <nuxt-link to="/policy"> Policy </nuxt-link>

    查看文档以获取更多信息 Nuxt Link