Recall & Review
beginner
What is a mixin in Vue?
A mixin is a reusable piece of code that can be included in Vue components to share options like data, methods, and lifecycle hooks.
Click to reveal answer
beginner
What is a composable in Vue 3?
A composable is a function that uses Vue's Composition API to encapsulate and reuse reactive state and logic across components.
Click to reveal answer
intermediate
How do composables improve code compared to mixins?
Composables provide better code organization, avoid naming conflicts, and make logic reuse more explicit and easier to understand.
Click to reveal answer
intermediate
What is a common problem with mixins?
Mixins can cause naming conflicts and make it hard to track where data or methods come from because they merge into the component silently.
Click to reveal answer
intermediate
Why are composables preferred in Vue 3 over mixins?
Because composables use plain functions, they are easier to test, understand, and compose together without hidden side effects.
Click to reveal answer
Which Vue feature uses functions to share reactive logic?
✗ Incorrect
Composable functions use Vue's Composition API to share reactive logic.
What is a downside of using mixins?
✗ Incorrect
Mixins merge their properties into components, which can cause naming conflicts.
Which approach is easier to test and understand in Vue 3?
✗ Incorrect
Composables are plain functions, making them easier to test and understand.
How do composables share logic?
✗ Incorrect
Composables return reactive state and functions to be used inside components.
Which Vue version introduced composables?
✗ Incorrect
Composables were introduced with Vue 3's Composition API.
Explain the main differences between composables and mixins in Vue.
Think about how each shares code and how that affects clarity and conflicts.
You got /5 concepts.
Describe why Vue 3 developers prefer composables over mixins.
Focus on benefits in code clarity and testing.
You got /5 concepts.