# Vuex (Legacy) (Vue.js / Nuxt.js) > Vuex 4 の store、state、mutations、actions、getters、modules、namespacing、Pinia への移行 - 15 面接問題 - Mid-Level - [面接問題: Vue.js / Nuxt.js](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions.md) ## 1. Vuex の store とは何ですか? **回答** Vuex の store は、Vue アプリケーションのグローバルな state を管理する集中型コンテナです。コンポーネントツリーを通じて手動で props を渡すことなく、複数のコンポーネント間でデータを共有できます。store は state が mutations を介してのみ予測可能な方法で変更されることを保証し、複雑なアプリケーションのデバッグと保守を容易にします。 ## 2. Vuex における mutations と actions の主な違いは何ですか? **回答** mutations は同期的で、state を直接変更する役割を担います。一方、actions は非同期で、mutations を commit する前に複雑なビジネスロジックを含めることができます。actions は API 呼び出し、タイマー、あらゆる非同期処理に最適です。結果を待ってから mutations を介して state を変更できるためです。この分離により、state の変更が Vue DevTools で追跡可能なまま保たれます。 ## 3. Vuex の store における getters は何のために使われますか? **回答** Vuex の getters は store の computed properties のように機能します。複数のコンポーネントでロジックを重複させることなく、state から派生した値を計算できます。getters はキャッシュされ、依存関係が変化したときにのみ再計算されるため、優れたパフォーマンスを提供します。state のデータをコンポーネントに公開する前にフィルタリング、ソート、変換するのに最適です。 ## さらに12問利用可能 - Vue コンポーネントから Vuex の state にどのようにアクセスしますか? - Vuex で API 呼び出しに mutations ではなく actions を使うのはなぜですか? 無料で登録: https://sharpskill.dev/ja/login ## その他のVue.js / Nuxt.js面接トピック - [JavaScript の基礎](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/javascript-fundamentals.md): 20問, Junior - [モダンな JavaScript (ES6+)](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/es6-modern-javascript.md): 20問, Junior - [Vue の基礎](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-basics.md): 22問, Junior - [Vue コンポーネント](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-components.md): 20問, Junior - [Vue Router](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-router.md): 18問, Junior - [Pinia State Management](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/pinia-state-management.md): 20問, Junior - [Composition API](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/composition-api.md): 24問, Mid-Level - [Vue のリアクティビティ](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-reactivity.md): 20問, Mid-Level - [Nuxt の基礎](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-fundamentals.md): 22問, Mid-Level - [Nuxt のデータフェッチング](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-data-fetching.md): 20問, Mid-Level - [Nuxt の SSR と SSG](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-ssr-ssg.md): 22問, Mid-Level - [Nuxt サーバールート](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-server-routes.md): 20問, Mid-Level - [Nuxt モジュール](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-modules.md): 18問, Mid-Level - [Vue のコンポーザブル](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-composables.md): 20問, Mid-Level - [Vue フォームとバリデーション](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-forms-validation.md): 20問, Mid-Level - [Nuxt の状態管理](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-state-management.md): 18問, Mid-Level - [Vue のテスト](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-testing.md): 20問, Mid-Level - [Nuxt のデプロイと CI/CD](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-deployment-cicd.md): 22問, Mid-Level - [Vue のパフォーマンス](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-performance.md): 22問, Senior - [Vue の高度なパターン](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-advanced-patterns.md): 24問, Senior - [VueでのTypeScript](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/typescript-vue.md): 22問, Senior - [Nuxt認証](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-auth.md): 20問, Senior - [Nuxt での SEO](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-seo.md): 20問, Senior - [Nuxt の国際化](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-i18n.md): 18問, Senior - [Vue アーキテクチャ](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-architecture.md): 22問, Senior - [Nuxt セキュリティ](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-security.md): 20問, Senior - [Vue エコシステム](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-ecosystem.md): 18問, Senior - [Vue 2→3 & Nuxt 2→3 の移行](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/migration-vue2-vue3-nuxt2-nuxt3.md): 22問, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vuex-legacy