0
0
Vueframework~20 mins

What is Vue - Practice Questions & Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Vue Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is Vue's primary purpose?
Vue is a popular tool in web development. What is its main job?
ATo style web pages with colors and fonts
BTo manage databases and server-side logic
CTo build user interfaces and single-page applications
DTo write backend APIs in Node.js
Attempts:
2 left
💡 Hint
Think about what you see and interact with on websites.
component_behavior
intermediate
2:00remaining
What happens when you update a reactive property in Vue?
In Vue, if you change a reactive data property, what does Vue do?
AIt ignores the change until the user refreshes the page
BIt reloads the entire webpage
CIt sends the data to the server immediately
DIt automatically updates the parts of the webpage that use that data
Attempts:
2 left
💡 Hint
Vue tracks data changes to keep the page in sync.
📝 Syntax
advanced
2:00remaining
Which Vue 3 syntax correctly defines a reactive state using Composition API?
Choose the correct way to create a reactive count variable in Vue 3 Composition API.
Aconst count = ref(0);
Bconst count = reactive(0);
Cconst count = reactive({ value: 0 });
Dconst count = ref({ count: 0 });
Attempts:
2 left
💡 Hint
Use ref for primitive values like numbers.
🔧 Debug
advanced
2:00remaining
Why does this Vue component not update the displayed count?
Look at this Vue 3 component code snippet: Why does clicking the button not change the number shown?
ABecause the template syntax {{ count }} is incorrect
BBecause count is a plain variable, not reactive, so Vue does not track changes
CBecause the increment function is not called on button click
DBecause the script setup block is missing the export default statement
Attempts:
2 left
💡 Hint
Vue needs reactive variables to update the UI automatically.
lifecycle
expert
2:00remaining
When does the Vue 'onMounted' lifecycle hook run?
In Vue 3, the 'onMounted' hook is used inside setup(). When exactly does it run?
AAfter the component is added to the DOM and rendered
BImmediately when the script setup block starts running
CWhen the component is destroyed and removed from the DOM
DBefore the component is created but after props are set
Attempts:
2 left
💡 Hint
Think about when you want to run code that needs the component visible on the page.