Vue · Middle · Question 52 of 75
Why prefer local imports over global app.component() registration?
- ✓Correct answer: Globally registered components can't be tree-shaken and make dependencies between components less visible
- 2Global components render slower
- 3Global registration doesn't work with
<script setup>
Explanation
With <script setup>, importing a component is enough to use it. Global registration fits a few truly ubiquitous base components.