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 면접 질문·
Senior
1

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

답변

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?

답변

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?

답변

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 면접 질문

다음 면접을 위해 Vue.js / Nuxt.js을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기