yux-storage
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "yux-storage", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "yux-storage 是一个基于 HTML5 IndexedDB 封装的 Web 本地数据离线存储库", | ||
@@ -5,0 +5,0 @@ "main": "yux-storage.js", |
@@ -304,2 +304,13 @@ # yux-storage | ||
同时也支持全局调用,可以通过监听 `document` 自定义事件 | ||
```js | ||
document.addEventListener('yuxStorage', ev => { | ||
// 自定义事件的数据在 ev.detail | ||
const [type, detail] = ev.detail; | ||
console.log(type, detail) | ||
// ‘setItem’, '{key, value}' | ||
}) | ||
``` | ||
> 支持多次调用 | ||
@@ -306,0 +317,0 @@ |
@@ -63,2 +63,5 @@ /** | ||
triggerEvent() { | ||
document.dispatchEvent(new CustomEvent('yuxStorage', { | ||
detail: [...arguments] | ||
})) | ||
this.eventList.forEach(fn => { | ||
@@ -65,0 +68,0 @@ fn(...arguments) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13672
124
327