Nuxt/examples/extend-app
Sébastien Chopin 0142dae008 Replace router-link to nuxt-link 2016-12-16 18:12:38 +01:00
..
layouts Update layout example 2016-12-07 23:44:22 +01:00
pages Replace router-link to nuxt-link 2016-12-16 18:12:38 +01:00
static Add pages/_app.vue possibility + example 2016-11-21 14:15:08 +01:00
README.md Update README.md 2016-12-09 14:32:19 -07:00
package.json Add pages/_app.vue possibility + example 2016-11-21 14:15:08 +01:00

README.md

Extending the main app

Nuxt.js allows you to extend the main application by adding a layouts/app.vue file

The default app

The default source code of the main app is:

<template>
  <nuxt-container>
    <nuxt/>
  </nuxt-container>
</template>

The layouts/app.vue file

🎬 Example video

You have to make sure to add the <nuxt-container> and <nuxt> components when extending the app.

It is important that the code you add stays inside <nuxt-container>.

Example:

<template>
  <nuxt-container>
    <div>My navigation bar here</div>
    <nuxt/>
  </nuxt-container>
</template>

Demo

npm install
npm start

Go to http://localhost:3000 and navigate trough the app. Notice how the logo at the top right stays between the pages, even on the error page: http://localhost:3000/404