You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/mutations.md
-18
Original file line number
Diff line number
Diff line change
@@ -75,24 +75,6 @@ mutations: {
75
75
}
76
76
```
77
77
78
-
### Silent Commit
79
-
80
-
> Note: This is a feature that will likely be deprecated once we implement mutation filtering in the devtools.
81
-
82
-
By default, every committed mutation is sent to plugins (e.g. the devtools). However in some scenarios you may not want the plugins to record every state change. Multiple commits to the store in a short period or polled do not always need to be tracked. In such cases you can pass a third argument to `store.commit` to "silence" that specific mutation from plugins:
83
-
84
-
```js
85
-
store.commit('increment', {
86
-
amount:1
87
-
}, { silent:true })
88
-
89
-
// with object-style commit
90
-
store.commit({
91
-
type:'increment',
92
-
amount:1
93
-
}, { silent:true })
94
-
```
95
-
96
78
### Mutations Follow Vue's Reactivity Rules
97
79
98
80
Since a Vuex store's state is made reactive by Vue, when we mutate the state, Vue components observing the state will update automatically. This also means Vuex mutations are subject to the same reactivity caveats when working with plain Vue:
Copy file name to clipboardExpand all lines: docs/fr/mutations.md
-18
Original file line number
Diff line number
Diff line change
@@ -75,24 +75,6 @@ mutations: {
75
75
}
76
76
```
77
77
78
-
### Commit silencieux
79
-
80
-
> Note : Cette fonctionnalité sera probablement dépréciée une fois que nous aurons implémenté le filtrage des mutations dans les devtools.
81
-
82
-
Par défaut, chaque mutation committée est envoyée aux plugins (i.e. les devtools). Cependant dans certains scénarios vous pourriez ne pas vouloir que les plugins enregistrent chaque changement de state. Plusieurs commits dans le store en un court laps de temps n'ont pas toujours besoin d'être tracés. Dans ce genre de cas, vous pouvez passer un troisième argument à `store.commit` afin de rendre cette mutation silencieuse aux yeux des plugins :
83
-
84
-
```js
85
-
store.commit('increment', {
86
-
amount:1
87
-
}, { silent:true })
88
-
89
-
// with object-style dispatch
90
-
store.commit({
91
-
type:'increment',
92
-
amount:1
93
-
}, { silent:true })
94
-
```
95
-
96
78
### Les mutations suivent les règles de réactivité de Vue
97
79
98
80
Puisqu'un state de store de Vuex est rendu réactif par Vue, lorsque nous mutons le state, les composants Vue observant ce state seront automatiquement mis à jour. Cela signifie également que les mutations Vuex sont sujettes aux mêmes inconvénients que lorsqu'on travaille avec Vue :
Copy file name to clipboardExpand all lines: docs/ru/mutations.md
+1-19
Original file line number
Diff line number
Diff line change
@@ -75,24 +75,6 @@ mutations: {
75
75
}
76
76
```
77
77
78
-
### Молчаливые мутации
79
-
80
-
> Замечание: Эта возможность вероятно будет помечена как нерекоммендованная к использованию после появления функционала фильтрации мутаций в devtools.
81
-
82
-
По умолчанию, каждая мутация попадает в плагины (например, в devtools). Иногда, впрочем, не хочется, чтобы плагины записывали каждое изменение состояния. Множественные мутации, происходящие в течении короткого периода времени не всегда необходимо отслеживать. В таких случаях существует возможность передать в `store.commit` третий параметр, чтобы "заставить замолчать" эту конкретную мутацию и сделать её невидимой в плагинах:
83
-
84
-
```js
85
-
store.commit('increment', {
86
-
amount:1
87
-
}, { silent:true })
88
-
89
-
// при использовании объектного синтаксиса
90
-
store.commit({
91
-
type:'increment',
92
-
amount:1
93
-
}, { silent:true })
94
-
```
95
-
96
78
### Мутации следуют правилам реактивности Vue
97
79
98
80
Поскольку состояние хранилища Vuex — это реактивная переменная Vue, при возникновении мутации зависящие от этого состояния компоненты Vue обновляются автоматически. Кроме того, это значит, что мутации Vuex имеют те же самые подводные камни, что и реактивность в обычном Vue:
@@ -183,4 +165,4 @@ store.commit('increment')
183
165
// к этому моменту уже должны произойти.
184
166
```
185
167
186
-
Для обработки асинхронных операций существуют [Действия](actions.md).
168
+
Для обработки асинхронных операций существуют [Действия](actions.md).
0 commit comments