소스 검색

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 년 전
부모
커밋
bb083ce432
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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')
       }
     }