What is the purpose of the src folder in a Vue project?
The src folder holds the main source code of the Vue app, including components, views, assets, and main entry files like main.js or main.ts. It's where you write your app's logic and UI.
Click to reveal answer
beginner
What does the components folder usually contain in a Vue project?
The components folder contains reusable Vue components. These are small building blocks like buttons, headers, or cards that you can use throughout your app.
Click to reveal answer
beginner
Why is the public folder important in a Vue project?
The public folder holds static files like index.html, images, or icons that are served directly without processing. It is the base HTML page that loads your Vue app.
Click to reveal answer
intermediate
What role does main.js or main.ts play in a Vue project?
This file is the app's entry point. It creates the Vue app instance, connects plugins, and mounts the app to the HTML page. Think of it as the starting point of your app.
Click to reveal answer
intermediate
What is the purpose of the views or pages folder in a Vue project?
The views or pages folder contains components that represent full pages or screens in your app. They often combine multiple smaller components and are linked to routes.
Click to reveal answer
Which folder in a Vue project typically contains reusable UI parts like buttons or cards?
Aviews
Bpublic
Cassets
Dcomponents
✗ Incorrect
The components folder holds reusable UI parts used throughout the app.
Where do you place static files like favicon.ico or robots.txt in a Vue project?
Asrc/assets
Bpublic
Ccomponents
Dviews
✗ Incorrect
Static files served as-is go into the public folder.
What is the main purpose of main.js or main.ts in a Vue project?
ACreate and mount the Vue app
BStore global styles
CDefine routes
DHold reusable components
✗ Incorrect
main.js or main.ts creates the Vue app instance and mounts it to the page.
Which folder usually contains components that represent full pages in a Vue app?
Aviews or pages
Bcomponents
Cassets
Dpublic
✗ Incorrect
views or pages hold components representing full pages or screens.
Where do you typically put images used inside your Vue components?
Apublic
Bviews
Csrc/assets
Dcomponents
✗ Incorrect
Images used inside components usually go in src/assets to be processed by build tools.
Describe the main folders in a Vue project and what each is used for.
Think about where you write code, where you keep static files, and how the app starts.
You got /5 concepts.
Explain the role of main.js or main.ts in starting a Vue app.
Consider what happens first when your app loads in the browser.
You got /4 concepts.
Practice
(1/5)
1. In a typical Vue project, where do you place your main application code like components and views?
easy
A. Inside the public/ folder
B. In the root project folder
C. Inside the src/ folder
D. Inside the node_modules/ folder
Solution
Step 1: Understand folder roles in Vue projects
The src/ folder is designed to hold your app's source code, including components and views.
Step 2: Identify correct folder for main code
The public/ folder holds static files like index.html, not app code.
Final Answer:
Inside the src/ folder -> Option C
Quick Check:
App code = src/ folder [OK]
Hint: Remember: src/ is for source code, public/ for static files [OK]
Common Mistakes:
Confusing public/ with src/ folder
Putting components in public/ folder
Placing code in node_modules/ folder
2. Which file in a Vue project typically serves as the entry point for the app?
easy
A. README.md in the root folder
B. index.html inside src/
C. package.json in the root folder
D. main.js or main.ts inside src/
Solution
Step 1: Identify entry point files in Vue
The entry point is usually a JavaScript or TypeScript file named main.js or main.ts inside src/.
Step 2: Differentiate from other files
index.html is a static file in public/, package.json manages dependencies, and README.md is documentation.
Final Answer:
main.js or main.ts inside src/ -> Option D
Quick Check:
Entry point = main.js/ts in src/ [OK]
Hint: Entry point is main.js or main.ts inside src/ [OK]
Which file is responsible for mounting the Vue app to the HTML page?
medium
A. App.vue
B. main.js
C. index.html
D. HelloWorld.vue
Solution
Step 1: Understand mounting in Vue
The main.js file usually creates the Vue app instance and mounts it to an element in index.html.
Step 2: Identify roles of other files
App.vue is the root component, index.html is the static HTML, and HelloWorld.vue is a child component.
Final Answer:
main.js -> Option B
Quick Check:
Mounting happens in main.js [OK]
Hint: Mounting code is in main.js, not components or HTML [OK]
Common Mistakes:
Thinking App.vue mounts the app
Choosing index.html as mounting file
Confusing child components with mounting logic
4. You see this error when running your Vue app: Cannot find module './components/HelloWorld.vue' What is the most likely cause related to project structure?
medium
A. The components folder is missing inside src/
B. The public/ folder is empty
C. The index.html file is inside src/
D. The main.js file is missing in the root folder
Solution
Step 1: Analyze the error message
The error says it cannot find the module ./components/HelloWorld.vue, meaning the import path is broken.
Step 2: Check folder structure relevance
If the components folder is missing inside src/, the import will fail. Other options do not affect this import.
Final Answer:
The components folder is missing inside src/ -> Option A
5. You want to add a global CSS file to your Vue project that should be included in every component. Where should you place this CSS file and how should you include it?
hard
A. Place it in src/assets/ and import it in main.js
B. Place it in public/ and link it in App.vue
C. Place it in src/components/ and import it in each component
D. Place it in the root folder and import it in index.html
Solution
Step 1: Identify best folder for global assets
The src/assets/ folder is used for styles and images that are part of the app source.
Step 2: Include global CSS properly
Importing the CSS file in main.js ensures it loads once and applies globally to all components.
Final Answer:
Place it in src/assets/ and import it in main.js -> Option A
Quick Check:
Global CSS in src/assets, imported in main.js [OK]
Hint: Global CSS goes in src/assets and imported in main.js [OK]
Common Mistakes:
Linking CSS in App.vue instead of main.js
Putting CSS in public/ folder without import
Importing CSS separately in every component
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.