瀏覽代碼

docs: update `state` option type (#951)

katashin 7 年之前
父節點
當前提交
c98b38a572
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      docs/en/api.md

+ 3 - 3
docs/en/api.md

@@ -12,11 +12,11 @@ const store = new Vuex.Store({ ...options })
 
 - **state**
 
-  - type: `Object`
+  - type: `Object | Function`
 
-    The root state object for the Vuex store.
+    The root state object for the Vuex store. [Details](state.md)
 
-    [Details](state.md)
+    If you pass a function that returns an object, the returned object is used as the root state. This is useful when you want to reuse the state object especially for module reuse. [Details](modules.md#module-reuse)
 
 - **mutations**