Skip to content
该翻译已同步到了 的版本,其对应的 commit hash 是 02a476d。

API 文档 / pinia / StoreDefinition

接口:StoreDefinition<Id, S, G, A> ​

pinia.StoreDefinition

类型参数 ​

名称类型
Idextends string = string
Sextends StateTree = StateTree
G_GettersTree<S>
A_ActionsTree

Callable ​

StoreDefinition ​

▸ StoreDefinition(pinia?, hot?): Store<Id, S, G, A>

返回一个 store,有需要才创建它。

参数 ​

名称类型描述
pinia?null | PiniaPinia instance to retrieve the store
hot?StoreGenericdev only hot module replacement

返回值 ​

Store<Id, S, G, A>

属性 ​

$id ​

• $id: Id

store 的 id。供映射辅助函数使用。

Released under the MIT License.