本插件库主要是基于 Pinia 开发,对现有的 Pinia 进行扩展,以方便快速开发。
piniaPlugins:中文文档
- 由于 vue2 即将停止更新。vue3 将成为主流版本,Pinia 虽然对 vue2 进行适配。但 本插件库未对 vue2 进行适配,也未对 SSR 进行适配。
从 1.0.0 版开始需用本插件 defineStore 替换Pinia 的 defineStore 方法
本插件对 Pinia 的 defineStore 的方法进行了封装,内部调用了官方 defineStore ,API 与官方 defineStore 同步。
插件名称 | 介绍 | 版本 |
---|---|---|
lifecyclePlugin | 在组件生命周期内调用 store 的方法 | 0.0.1 |
lifecyclePlugin | use时传参会变成钩子的方法参数 | 1.0.0 |
storagePlugin | store 数据持久化 | 0.0.1 |
dicPlugin | store 数据字典查询 | 0.0.1 |
historyPlugin | store 缓存历史数据 | 0.0.1 |
historyPlugin-pushHistoryFunc | store 缓存函数返回的历史项 | 1.2.0 |
historyPlugin-unshiftHistoryFunc | store 缓存异步历史数据 | 1.2.0 |
setupPlugin | setup时调用store方法 | 1.1.0 |