Browse Source

Mini fix in rootState example. (#629)

* Mini fix in rootState example.

Maybe I misunderstood the example, but without parenthesis the `%` operator will be executed before the `+`.

* Update modules.md
Agustin Arias 8 năm trước cách đây
mục cha
commit
bb083ce432
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      docs/en/modules.md

+ 1 - 1
docs/en/modules.md

@@ -58,7 +58,7 @@ const moduleA = {
   // ...
   actions: {
     incrementIfOddOnRootSum ({ state, commit, rootState }) {
-      if (state.count + rootState.count % 2 === 1) {
+      if ((state.count + rootState.count) % 2 === 1) {
         commit('increment')
       }
     }