Ver Fonte

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 há 8 anos atrás
pai
commit
bb083ce432
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      docs/en/modules.md

+ 1 - 1
docs/en/modules.md

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