Skip to content

fix: elaborate on "non-flux state management" #2469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/v2/style-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ While attribute values without any spaces are not required to have quotes in HTM

``` html
<template v-slot:header>
<h1>Here might be a page title</h1>
<h1>Here might be a page title</h1>
</template>

<template #footer>
Expand Down Expand Up @@ -1496,7 +1496,7 @@ While attribute values without any spaces are not required to have quotes in HTM

``` html
<template v-slot:header>
<h1>Here might be a page title</h1>
<h1>Here might be a page title</h1>
</template>

<template v-slot:footer>
Expand All @@ -1506,7 +1506,7 @@ While attribute values without any spaces are not required to have quotes in HTM

``` html
<template #header>
<h1>Here might be a page title</h1>
<h1>Here might be a page title</h1>
</template>

<template #footer>
Expand Down Expand Up @@ -1941,7 +1941,9 @@ Vue.component('TodoItem', {

**[Vuex](https://github.com/vuejs/vuex) should be preferred for global state management, instead of `this.$root` or a global event bus.**

Managing state on `this.$root` and/or using a [global event bus](https://vuejs.org/v2/guide/migration.html#dispatch-and-broadcast-replaced) can be convenient for very simple cases, but are not appropriate for most applications. Vuex offers not only a central place to manage state, but also tools for organizing, tracking, and debugging state changes.
Managing state on `this.$root` and/or using a [global event bus](https://vuejs.org/v2/guide/migration.html#dispatch-and-broadcast-replaced) can be convenient for very simple cases, but it is not appropriate for most applications.

Vuex is the [official flux-like implementation](https://vuejs.org/v2/guide/state-management.html#Official-Flux-Like-Implementation) for Vue, and offers not only a central place to manage state, but also tools for organizing, tracking, and debugging state changes. It integrates well in the Vue ecosystem (including full [Vue DevTools](https://vuejs.org/v2/guide/installation.html#Vue-Devtools) support).

{% raw %}</details>{% endraw %}

Expand Down