0
0
Vueframework~20 mins

Vue project structure walkthrough - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Vue Project Structure Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the role of the 'src' folder in a Vue project
In a typical Vue 3 project, what is the main purpose of the 'src' folder?
AIt contains the source code files like components, views, and main app setup.
BIt stores the compiled production files ready for deployment.
CIt holds configuration files like package.json and vite.config.js.
DIt contains static assets like images and fonts only.
Attempts:
2 left
💡 Hint
Think about where you write your Vue components and main app logic.
component_behavior
intermediate
2:00remaining
Behavior of components inside the 'components' folder
What is the typical use of the 'components' folder inside the 'src' directory in a Vue project?
AIt holds configuration files for Vue Router.
BIt stores reusable Vue components that can be used across multiple views.
CIt is used to store CSS stylesheets only.
DIt contains only the root App.vue file.
Attempts:
2 left
💡 Hint
Think about components you want to reuse in different parts of your app.
📝 Syntax
advanced
2:00remaining
Correct import path for a component in Vue 3
Given a Vue project structure where src/components/Button.vue exists, which import statement correctly imports this Button component into src/views/Home.vue?
Aimport Button from '../components/Button.vue';
Bimport Button from './components/Button.vue';
Cimport Button from '../../components/Button.vue';
Dimport Button from '/components/Button.vue';
Attempts:
2 left
💡 Hint
Consider the relative path from 'views' folder to 'components' folder.
🔧 Debug
advanced
2:00remaining
Identifying the cause of a missing component error
You see the error 'Failed to resolve component: Navbar' when running your Vue app. Your project structure has src/components/Navbar.vue and you imported it in src/App.vue with import Navbar from './components/Navbar.vue'. What is the most likely cause?
AThe import path should be './component/Navbar.vue' (missing 's').
BThe Navbar.vue file must be inside the 'views' folder, not 'components'.
CYou forgot to register the Navbar component in the components option or script setup.
DVue does not support importing components with .vue extension.
Attempts:
2 left
💡 Hint
Check if you declared the component properly after importing.
lifecycle
expert
3:00remaining
Order of lifecycle hooks in a Vue 3 component
What is the correct order of these Vue 3 lifecycle hooks when a component is created and mounted? Options list the hooks in order.
A3, 1, 2, 4
B2, 1, 3, 4
C1, 3, 2, 4
D1, 2, 3, 4
Attempts:
2 left
💡 Hint
Remember the lifecycle starts before creation and ends after mounting.