pinia-cache-plugin
Advanced tools
+6
-6
@@ -7,3 +7,3 @@ import { PiniaPlugin } from 'pinia'; | ||
| } | ||
| interface DefCachePiniaPluginOptions { | ||
| interface DefPiniaCachePluginOptions { | ||
| allCache: boolean; | ||
@@ -14,3 +14,3 @@ excludeNameArray: string[]; | ||
| } | ||
| interface CachePiniaPluginOptions extends Partial<DefCachePiniaPluginOptions> { | ||
| interface PiniaCachePluginOptions extends Partial<DefPiniaCachePluginOptions> { | ||
| } | ||
@@ -21,9 +21,9 @@ /** | ||
| * const store = createPinia(); | ||
| * store.use(cachePiniaPlugin(options)) | ||
| * store.use(piniaCachePlugin(options)) | ||
| * ``` | ||
| * @param options {@link CachePiniaPluginOptions} | ||
| * @param options {@link PiniaCachePluginOptions} | ||
| * @returns PiniaPlugin | ||
| */ | ||
| declare const cachePiniaPlugin: (options?: CachePiniaPluginOptions) => PiniaPlugin; | ||
| declare const piniaCachePlugin: (options?: PiniaCachePluginOptions) => PiniaPlugin; | ||
| export { cachePiniaPlugin as default }; | ||
| export { piniaCachePlugin as default }; |
+5
-5
| (function (global, factory) { | ||
| typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
| typeof define === 'function' && define.amd ? define(factory) : | ||
| (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.cachePiniaPlugin = factory()); | ||
| (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.piniaCachePlugin = factory()); | ||
| })(this, (function () { 'use strict'; | ||
@@ -17,8 +17,8 @@ | ||
| * const store = createPinia(); | ||
| * store.use(cachePiniaPlugin(options)) | ||
| * store.use(piniaCachePlugin(options)) | ||
| * ``` | ||
| * @param options {@link CachePiniaPluginOptions} | ||
| * @param options {@link PiniaCachePluginOptions} | ||
| * @returns PiniaPlugin | ||
| */ | ||
| var cachePiniaPlugin = function (options) { | ||
| var piniaCachePlugin = function (options) { | ||
| // 参数合并 | ||
@@ -117,4 +117,4 @@ var _options = Object.assign({ | ||
| return cachePiniaPlugin; | ||
| return piniaCachePlugin; | ||
| })); |
+4
-4
@@ -11,8 +11,8 @@ // 存储在localStorage的key | ||
| * const store = createPinia(); | ||
| * store.use(cachePiniaPlugin(options)) | ||
| * store.use(piniaCachePlugin(options)) | ||
| * ``` | ||
| * @param options {@link CachePiniaPluginOptions} | ||
| * @param options {@link PiniaCachePluginOptions} | ||
| * @returns PiniaPlugin | ||
| */ | ||
| var cachePiniaPlugin = function (options) { | ||
| var piniaCachePlugin = function (options) { | ||
| // 参数合并 | ||
@@ -111,2 +111,2 @@ var _options = Object.assign({ | ||
| export { cachePiniaPlugin as default }; | ||
| export { piniaCachePlugin as default }; |
+1
-1
| { | ||
| "name": "pinia-cache-plugin", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "pinia state cache plugin (pinia状态持久化缓存插件)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+2
-1
@@ -16,2 +16,3 @@ # pinia-cache-plugin | ||
| import { createPinia } from 'pinia'; | ||
| import piniaCachePlugin from 'pinia-cache-plugin'; | ||
@@ -29,3 +30,3 @@ const store = createPinia(); | ||
| }, */ | ||
| store.use(cachePiniaPlugin(options)); | ||
| store.use(piniaCachePlugin(options)); | ||
| ``` | ||
@@ -32,0 +33,0 @@ |
12557
0.41%52
1.96%