Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Latest commit

 

History

History
40 lines (31 loc) · 1.27 KB

File metadata and controls

40 lines (31 loc) · 1.27 KB
icon title description head.title
IconFile
app.vue
The app.vue file is the main component in your Nuxt 3 applications.
App file

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.

<template>
  <h1>Hello World!</h1>
</template>

Usage with pages

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

<template>
  <div>
    <NuxtLayout>
      <NuxtPage/>
    </NuxtLayout>
  </div>
</template>

::alert{type=info} Since Nuxt 3 uses <Suspense> inside <NuxtPage>, we recommend to wrap it into a single root element. ::

::alert{type=warning} 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.