Skip to content

Complete guide to

Mastering Pinia

written by its creator

该翻译已同步到了 的版本,其对应的 commit hash 是 c67a5c9

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.