mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-10-25 10:35:24 +00:00
init
This commit is contained in:
22
template/src/ext/storage.js
Normal file
22
template/src/ext/storage.js
Normal file
@@ -0,0 +1,22 @@
|
||||
export default {
|
||||
get (key) {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem(key))
|
||||
} catch (e) {}
|
||||
},
|
||||
set (key, val) {
|
||||
try {
|
||||
localStorage.setItem(key, JSON.stringify(val))
|
||||
} catch (e) {}
|
||||
},
|
||||
remove (key) {
|
||||
try {
|
||||
localStorage.removeItem(key)
|
||||
} catch (e) {}
|
||||
},
|
||||
clear () {
|
||||
try {
|
||||
localStorage.clear()
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user