From 773714f739c9f188552d2997eb06e0660abf2c96 Mon Sep 17 00:00:00 2001 From: zhw2590582 Date: Sun, 12 May 2019 10:02:42 +0800 Subject: [PATCH] =?UTF-8?q?localStorage=20=E6=B7=BB=E5=8A=A0=20del=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/artplayer/src/storage.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/artplayer/src/storage.js b/packages/artplayer/src/storage.js index 81f2bdd1a..13d6b51b0 100644 --- a/packages/artplayer/src/storage.js +++ b/packages/artplayer/src/storage.js @@ -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); }