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

API 文档 / pinia / PiniaPlugin

接口:PiniaPlugin

pinia.PiniaPlugin

Callable

PiniaPlugin

PiniaPlugin(context): void | Partial<PiniaCustomProperties<string, StateTree, _GettersTree<StateTree>, _ActionsTree> & PiniaCustomStateProperties<StateTree>>

用于扩展每个 store 的插件。返回一个扩展 store 的对象或 没有返回值。

参数

名称类型描述
contextPiniaPluginContext<string, StateTree, _GettersTree<StateTree>, _ActionsTree>Context

返回值

void | Partial<PiniaCustomProperties<string, StateTree, _GettersTree<StateTree>, _ActionsTree> & PiniaCustomStateProperties<StateTree>>

Released under the MIT License.