vue-local-storage icon indicating copy to clipboard operation
vue-local-storage copied to clipboard

Support for clear() method

Open dorinniscu opened this issue 7 years ago • 2 comments

The library does not include the clear() method so we can clear all data. (window.localStorage.clear())

dorinniscu avatar Jun 28 '18 10:06 dorinniscu

See #40

cedricium avatar Aug 10 '18 16:08 cedricium

Hi team,

First, congrats for this lib! It's very useful!

I see the solution with "window.localStorage.clear()" in issue #40, but has a difference with a self implementation. Using clear from native JS will delete all the data structure declared in App.vue. This is a problem in some sittuations, e.g., if you need to clear storage data from an authenticated user to change for other. In moment of second user login, the structure does not exists anymore, and reports a error like: Expected a number. In true, the references is now undefined.

Thanks for any enhance.

carromeu avatar Sep 20 '18 20:09 carromeu