Master.Deep
Master.Deep

Reputation: 812

Nuxt js static pages relative URL

I am working on some static pages using Nuxt.js (MPA). Whenever I run the generate command, all <nuxt-link> URLs start from root, i.e /. For example, my structure is:

pages
    |
     - index.vue
     - policy.vue

And in index.vue I have linked policy page as:

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

which results in /policy.html instead of policy.html.

Upvotes: 1

Views: 3941

Answers (1)

CMarzin
CMarzin

Reputation: 349

You need to replace policy.html by a path so like this

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

Right : <nuxt-link to="/policy"> Policy </nuxt-link>

Check the docs for more informations Nuxt Link

Upvotes: 1

Related Questions