
Nuxt Fundamentals
Nuxt structure, pages directory, auto-routing, layouts, app.vue, server directory, nuxt.config
1What is the minimum required structure for a Nuxt 3 application?
What is the minimum required structure for a Nuxt 3 application?
Answer
A Nuxt 3 application requires only an app.vue file or a pages/ directory at the project root. If app.vue exists without a pages/ folder, Nuxt creates an application without Vue Router. If pages/ exists, Nuxt automatically enables file-based routing and requires <NuxtPage /> in app.vue to display routes.
2How does automatic routing work in the pages/ directory?
How does automatic routing work in the pages/ directory?
Answer
Nuxt's pages/ directory uses file-based routing: each .vue file automatically creates a corresponding route. For example, pages/index.vue becomes the '/' route, pages/about.vue becomes '/about', and pages/blog/[id].vue creates a dynamic route '/blog/:id'. This approach eliminates manual router configuration.
3What is the role of the <NuxtPage /> component in app.vue?
What is the role of the <NuxtPage /> component in app.vue?
Answer
The <NuxtPage /> component is an outlet that displays the active page content based on the current route. It is mandatory in app.vue when the pages/ directory exists. Without <NuxtPage />, routes will not be displayed. It is equivalent to <router-view /> in standard Vue Router but adapted for Nuxt.
How to apply a specific layout to a page in Nuxt 3?
What is the difference between using <NuxtLayout> in app.vue and not using it?
+19 interview questions
Other Vue.js / Nuxt.js interview topics
JavaScript Fundamentals
Modern JavaScript (ES6+)
Vue Basics
Vue Components
Vue Router
Pinia State Management
Vuex (Legacy)
Composition API
Vue Reactivity
Nuxt Data Fetching
Nuxt SSR & SSG
Nuxt Server Routes
Nuxt Modules
Vue Composables
Vue Forms & Validation
Nuxt State Management
Vue Testing
Nuxt Deployment & CI/CD
Vue Performance
Vue Advanced Patterns
TypeScript with Vue
Nuxt Authentication
SEO with Nuxt
Nuxt Internationalization
Vue Architecture
Nuxt Security
Vue Ecosystem
Migration Vue 2→3 & Nuxt 2→3
Master Vue.js / Nuxt.js for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free