Usage
Minimal Usage
With Nuxt, theapp/pages/ directory is optional. If it is not present, Nuxt will not include the vue-router dependency. This is useful when building a landing page or an application that does not require routing.
app/app.vue
Usage with Pages
When you have anapp/pages/ directory, you need to use the <NuxtPage> component to display the current page:
app/app.vue
app.vue. This is useful when you want to include global elements such as a header or footer:
app/app.vue
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.Usage with Layouts
When your application requires different layouts for different pages, you can use theapp/layouts/ directory with the <NuxtLayout> component. This allows you to define multiple layouts and apply them per page.
app/app.vue
Learn more about layouts
Discover how to structure your layouts using the
app/layouts/ directory.