Rendering

Server Side Rendered Sites and Static Sites

Static sites are very similar to server-side rendered applications with the main difference being that static sites are rendered at build time, therefore no server is needed. Navigating from one page to another is then on the client-side.

Server-side rendered sites are rendered on the server each time the user requests a page, therefore a server is needed to be able to serve the page on each request.

See deployment targets for more info on static and server hosting

nuxt.config.js
export default {
  ssr: true // default value
}

You do not need to add ssr: true to your nuxt config in order to enable server-side-rendering as it is enabled by default.

SPA

With Single Page Applications there is no server-side rendering, only client-side rendering. Client side rendering means rendering the content in the browser using JavaScript. Instead of getting all of the content from the HTML we just get a basic HTML document with a JavaScript file that will then render the rest of the site using the browser. To deploy a single page application set ssr to false and then use the build command to build your application.

nuxt.config.js
export default {
  ssr: false
}

Vous avez vu une erreur ou vous souhaitez contribuer à la documentation ? Éditez cette page sur GitHub !