mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-27 00:38:20 +08:00
Added: plugin reload state in localstorage
This commit is contained in:
15
src/renderer/utils/LS.js
Normal file
15
src/renderer/utils/LS.js
Normal file
@@ -0,0 +1,15 @@
|
||||
class LS {
|
||||
get (name) {
|
||||
if (localStorage.getItem(name)) {
|
||||
return JSON.parse(localStorage.getItem(name))
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
set (name, value) {
|
||||
return localStorage.setItem(name, JSON.stringify(value))
|
||||
}
|
||||
}
|
||||
|
||||
export default new LS()
|
||||
Reference in New Issue
Block a user