App file

The app.vue file is the main component in your Nuxt 3 applications.

Minimal usage

With Nuxt 3, the pages/ directory is optional. If not present, Nuxt won’t include vue-router dependency. This is useful when working on a landing page or an application that does not need routing.

app.vue

  1. <template>
  2. <h1>Hello World!</h1>
  3. </template>

Usage with pages

If you have a pages/ directory, to display the current page, use the <NuxtPage> component:

app.vue

  1. <template>
  2. <div>
  3. <NuxtLayout>
  4. <NuxtPage/>
  5. </NuxtLayout>
  6. </div>
  7. </template>

Since Nuxt 3 uses inside <NuxtPage>, we recommend to wrap it into a single root element.

Remember that app.vue acts as the main component of your Nuxt application. Anything you add to it (JS and CSS) will be global and included in every page.

If you want to have the possibility to customize the structure around the page between pages, check out the layouts/ directory.