
Vuex (Legacy)
Vuex 4 store, state, mutations, actions, getters, modules, namespacing, migration to Pinia
1What is a Vuex store?
What is a Vuex store?
Resposta
A Vuex store is a centralized container that manages the global state of a Vue application. It allows sharing data between multiple components without manually passing props through the component tree. The store ensures that state can only be modified predictably through mutations, which simplifies debugging and maintenance of complex applications.
2What is the main difference between mutations and actions in Vuex?
What is the main difference between mutations and actions in Vuex?
Resposta
Mutations are synchronous and directly responsible for modifying state, while actions are asynchronous and can contain complex business logic before committing mutations. Actions are ideal for API calls, timers, or any asynchronous operations, as they can wait for results before modifying state via mutations. This separation ensures that state modifications remain traceable in Vue DevTools.
3What are getters used for in a Vuex store?
What are getters used for in a Vuex store?
Resposta
Getters in Vuex work like computed properties for the store. They allow computing derived values from state without duplicating logic across multiple components. Getters are cached and only recalculate when their dependencies change, providing good performance. They are perfect for filtering, sorting, or transforming state data before exposing it to components.
How to access Vuex state from a Vue component?
Why use actions instead of mutations for API calls in Vuex?
+12 perguntas de entrevista
Outros temas de entrevista Vue.js / Nuxt.js
JavaScript Fundamentals
Modern JavaScript (ES6+)
Vue Basics
Vue Components
Vue Router
Pinia State Management
Composition API
Vue Reactivity
Nuxt Fundamentals
Nuxt Data Fetching
Nuxt SSR & SSG
Nuxt Server Routes
Nuxt Modules
Vue Composables
Vue Forms & Validation
Nuxt State Management
Vue Testing
Nuxt Deployment & CI/CD
Vue Performance
Vue Advanced Patterns
TypeScript with Vue
Nuxt Authentication
SEO with Nuxt
Nuxt Internationalization
Vue Architecture
Nuxt Security
Vue Ecosystem
Migration Vue 2→3 & Nuxt 2→3
Domine Vue.js / Nuxt.js para sua proxima entrevista
Acesse todas as perguntas, flashcards, testes tecnicos, exercicios de code review e simuladores de entrevista.
Comece gratis