Skip to content

Commit bb76bfd

Browse files
kazuponktsn
authored andcommitted
Update ja docs (#986)
* add core concepts docs NOTE: pick up from 5257afe * add missing typings docs NOTE: pick up from 7ad573b * translation missing typings * update state docs NOTE: pick up from 80b856a * update core concepts docs * tweak translation for ja * fix nuance * docs(ja): sync from en docs * translate previous commit * docs(ja): fix docs testing * docs: fix translation
1 parent 97961df commit bb76bfd

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

docs/ja/SUMMARY.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# Vuex
22

3-
<!--email_off-->
4-
> 注意: これは [email protected] のドキュメントです
5-
<!--/email_off-->
3+
> 注意: TypeScript ユーザ向けは、vuex@>= 3.0 と vue@>=2.5 が必須、逆もまた同様です。
64
7-
- [1.0のドキュメントをお探しですか?](https://github.com/vuejs/vuex/tree/1.0/docs/ja)
85
- [リリースノート](https://github.com/vuejs/vuex/releases)
96
- [インストール](installation.md)
107
- [Vuex とは何か?](intro.md)

docs/ja/api.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ const store = new Vuex.Store({ ...options })
1212

1313
- **state**
1414

15-
- 型: `Object`
15+
- 型: `Object | Function`
1616

17-
ストアのための ルートステートオブジェクトです。
17+
ストアのための ルートステートオブジェクトです。[詳細](state.md)
1818

19-
[詳細](state.md)
19+
オブジェクトを返す関数を渡す場合、返されたオブジェクトはルートステートとして使用されます。これは特にモジュールの再利用のためにステートオブジェクトを再利用する場合に便利です。[詳細](modules.md#モジュールの再利用)
2020

2121
- **mutations**
2222

@@ -156,10 +156,27 @@ const store = new Vuex.Store({ ...options })
156156

157157
プラグインの中でもっともよく利用されます。[詳細](plugins.md)
158158

159-
- **`registerModule(path: string | Array<string>, module: Module)`**
159+
- **`subscribeAction(handler: Function)`**
160+
161+
> 2.5.0 で新規追加
162+
163+
ストアアクションを購読します。`handler` はディスパッチされたアクションごとに呼び出され、アクション記述子と現在のストア状態を引数として受け取ります:
164+
165+
``` js
166+
store.subscribeAction((action, state) => {
167+
console.log(action.type)
168+
console.log(action.payload)
169+
})
170+
```
171+
172+
 プラグインで最も一般的に使用されます。[Details](plugins.md)
173+
174+
- **`registerModule(path: string | Array<string>, module: Module, options?: Object)`**
160175

161176
動的なモジュールを登録します。[詳細](modules.md#dynamic-module-registration)
162177

178+
`options` は前の状態を保存する `preserveState: true` を持つことができます。サーバサイドレンダリングに役立ちます。
179+
163180
- **`unregisterModule(path: string | Array<string>)`**
164181

165182
動的なモジュールを解除します。[詳細](modules.md#dynamic-module-registration)

docs/ja/modules.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ store.registerModule(['nested', 'myModule'], {
269269

270270
`store.unregisterModule(moduleName)` を呼び出せば、動的に登録したモジュールを削除できます。ただしストア作成(store creation)の際に宣言された、静的なモジュールはこのメソッドで削除できないことに注意してください。
271271

272+
サーバサイドレンダリングされたアプリケーションから状態を保持するなど、新しいモジュールを登録するときに、以前の状態を保持したい場合があります。`preserveState` オプション(`store.registerModule('a', module, { preserveState: true })`)でこれを実現できます。
273+
272274
### モジュールの再利用
273275

274276
時どき、モジュールの複数インスタンスを作成する必要があるかもしれません。例えば:

docs/ja/plugins.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ const logger = createLogger({
116116
// ミューテーションは、`{ type, payload }` の形式でログ出力されます
117117
// 任意の方法でそれをフォーマットできます
118118
return mutation.type
119-
}
119+
},
120+
logger: console, // `console` API の実装, デフォルトは `console`
120121
})
121122
```
122123

docs/ja/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,4 @@ mocha test-bundle.js
218218

219219
#### Karma + karma-webpack を使ったブラウザでの実行
220220

221-
[vue-loader documentation](http://vue-loader.vuejs.org/en/workflow/testing.html) 内のセットアップ方法を参考にしてください。
221+
[vue-loader ドキュメント](https://vue-loader.vuejs.org/ja/workflow/testing.html) 内のセットアップ方法を参考にしてください。

0 commit comments

Comments
 (0)