mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-17 14:27:37 +08:00
16 lines
270 B
JavaScript
16 lines
270 B
JavaScript
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()
|