API 文档 • 文档
API 文档 / pinia / StoreDefinition
接口: StoreDefinition()<Id, S, G, A>
defineStore() 的返回值。允许实例化存储的函数。
扩展自
类型参数
• Id extends string = string
• S extends StateTree = StateTree
• G = _GettersTree<S>
• A = _ActionsTree
StoreDefinition(
pinia?,hot?):Store<Id,S,G,A>
返回一个存储,如果需要则创建它。
参数
• pinia?: null | Pinia
Pinia 实例以检索存储
• hot?: StoreGeneric
仅开发环境的热模块替换
返回
Store<Id, S, G, A>
属性
$id
$id:
Id
存储的 ID。由映射助手使用。