Vuex

What's Vuex

  • State management pattern
  • Shared State out of components

Core Concepts Of Vuex

  • State
  • Getters
  • Mutations
  • Actions
  • Modules

State

SSOT

Mutations

Only way to change state

Must be synchronous

Getters

Computed state base on store state

Actions

Async operations

Commit mutations

Modules

Divide store into modules

Namespace

Vuex

By 徐祁

Vuex

  • 1,124