Search code examples
vue.jsnuxt.jsserver-side-rendering

How can I turn off SSR for only certain pages in Nuxt.js to use them as SPA application?


I want to develop an application with Nuxt.js that uses SSR for only certain pages (like artist page user page), so the pages without SSR will be used like an SPA. Is it possible to do it using Nuxt.js?


Solution

  • Starting with Nuxt 3.11, you can add the .client or .server suffix to the file of a page and restrict where it would be rendered. Some examples:

    • comments.client.vue;
    • artist.server.vue