Vue.js Developer interview question · Most asked

What are the main breaking changes when migrating from Vue 2 to Vue 3?

Summary

The app is created with createApp() instead of new Vue(); global APIs moved to the app instance; v-model on components uses modelValue/update:modelValue (and .sync was removed); filters, $on/$off event buses, $listeners and $children were removed; v-if now has priority over v-for; functional and async component syntax changed; and Vue Router 4, Pinia (instead of Vuex 3) and Vite are the standard stack.

Longer Answer

Strategy: upgrade to Vue 2.7 first (it backports the Composition API and <script setup>), remove deprecated patterns, then use the migration build (@vue/compat), which runs Vue 3 with Vue 2 behaviour where possible and logs warnings for each incompatibility. Third-party component libraries are usually the biggest blocker (for example, moving from Vuetify 2 to 3). Vue 2 reached end of life on 31 December 2023, so staying on it means no security fixes.

Key Points

  • createApp and app-level APIs.
  • v-model and .sync changes; filters and event bus removed.
  • Go via Vue 2.7 and @vue/compat.
  • Libraries are the main blocker; Vue 2 is EOL.

Explanation

What interviewers look for

Experience with an actual migration: the compat build, library blockers, and incremental strategy.

More most-asked Vue.js Developer questions

← All Vue.js Developer questions