mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-13 15:56:15 -08:00
localStorage 添加 del 方法
This commit is contained in:
1 parent
6f34ea0da0
commit
773714f739
1 file changed
+6
@@ -25,6 +25,12 @@ export default class Storage {
|
||||
window.localStorage.setItem(this.name, JSON.stringify(storage));
|
||||
}
|
||||
|
||||
del(key) {
|
||||
const storage = this.get();
|
||||
delete storage[key];
|
||||
window.localStorage.setItem(this.name, JSON.stringify(storage));
|
||||
}
|
||||
|
||||
clean() {
|
||||
window.localStorage.removeItem(this.name);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user