Vue.js / Nuxt.js

Migration Vue 2→3 & Nuxt 2→3

Options API to Composition API, Vuex to Pinia, asyncData/fetch to useFetch, breaking changes, migration strategies, nuxtServerInit deprecation

22 gespreksvragen·
Senior
1

What is the main architectural difference between Vue 2's Options API and Vue 3's Composition API?

Antwoord

The Composition API organizes code by logical concern rather than by option type, allowing related code to be grouped together. This approach improves readability and maintainability of complex components, unlike the Options API which separates data, methods, and computed properties. The Composition API also facilitates logic reuse through composables, effectively replacing mixins that could create naming conflicts.

2

What major change did Nuxt 3 introduce regarding auto-imports compared to Nuxt 2?

Antwoord

Nuxt 3 enables auto-imports by default for composables, components, and framework utilities, eliminating the need for manual imports. This feature improves developer experience and reduces boilerplate code. Nuxt 2 required explicit imports for most functionalities. This feature can be disabled in the configuration if needed for explicit control reasons.

3

In Vue 3, what method replaces Vue 2 filters that have been removed?

Antwoord

Filters were removed in Vue 3 because they created custom syntax that was difficult for new developers to understand and impacted performance. The official recommendation is to use computed properties or methods for data transformations. Computed properties offer the advantage of automatic caching for expensive calculations, while methods are suitable for simple transformations with parameters.

4

What is the default build tool in Nuxt 3, replacing Nuxt 2's Webpack?

5

How did the v-model syntax change between Vue 2 and Vue 3 for custom components?

+19 gespreksvragen

Beheers Vue.js / Nuxt.js voor je volgende gesprek

Krijg toegang tot alle vragen, flashcards, technische tests, code review-oefeningen en gespreksimulatoren.

Begin gratis