0
0
Vueframework~20 mins

Nuxt project structure in Vue - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Nuxt Structure Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
What is the role of the pages directory in a Nuxt project?

In a Nuxt project, the pages directory is special. What does Nuxt do with the files inside this folder?

AIt contains server middleware functions for API handling.
BIt automatically generates routes based on the file names inside <code>pages</code>.
CIt holds configuration files for Nuxt plugins.
DIt stores global CSS styles for the entire project.
Attempts:
2 left
💡 Hint

Think about how Nuxt creates URLs for your app automatically.

📝 Syntax
intermediate
1:30remaining
Which folder in Nuxt is used to store reusable Vue components?

In a Nuxt project, where should you place Vue components that you want to reuse across pages?

A<code>plugins</code> directory
B<code>layouts</code> directory
C<code>pages</code> directory
D<code>components</code> directory
Attempts:
2 left
💡 Hint

Think about where you keep small building blocks used in many places.

🔧 Debug
advanced
2:30remaining
Why does placing a Vue file inside layouts affect the app's appearance?

Consider this: You add a new Vue file inside the layouts folder and set it as default layout. What effect does this have?

AIt replaces the <code>components</code> folder content with the layout content.
BIt automatically registers new routes for each layout file.
CIt changes the overall page structure by wrapping pages with the layout's template.
DIt disables the <code>pages</code> directory routing.
Attempts:
2 left
💡 Hint

Think about how layouts work in websites to keep a consistent look.

state_output
advanced
2:00remaining
What happens if you place a file named index.vue inside pages/blog?

In a Nuxt project, you add pages/blog/index.vue. What URL path will this file correspond to?

A/blog
B/blog/index
C/index/blog
D/
Attempts:
2 left
💡 Hint

Remember how index.vue files map to folder root paths.

🧠 Conceptual
expert
3:00remaining
Which Nuxt directory is best suited for placing server-side API route handlers?

You want to add backend API routes inside your Nuxt project. Which directory should you use to place these server-side handlers?

Aserver/api
Bpages/api
Cplugins/api
Dcomponents/api
Attempts:
2 left
💡 Hint

Think about where Nuxt expects server code separate from frontend pages.