You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
360 B
11 lines
360 B
2 years ago
|
//用于监听本地缓存
|
||
|
export default function dispatchEventStroage () {
|
||
|
const signSetItem = localStorage.setItem
|
||
|
localStorage.setItem = function (key, val) {
|
||
|
let setEvent = new Event('setItemEvent')
|
||
|
setEvent.key = key
|
||
|
setEvent.newValue = val
|
||
|
window.dispatchEvent(setEvent)
|
||
|
signSetItem.apply(this, arguments)
|
||
|
}
|
||
|
}
|