ankurk91 / vue-web-storage

Vue.js plugin for local storage and session storage (1.8 kb min+gz) :floppy_disk:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hasKey doesn't work

Tusko opened this issue · comments

hasKey(key) {

I have a problem with hasKey method
http://cl.ly/c4286b58284d

How are you using this package?
Can you share the package installation and configuration code?

Your screenshot says that hasKey method is not available on undefined.

In app.js (main Vue file added the code:

import Storage from 'vue-web-storage';  
Vue.use(Storage); 

Vue.use(Storage, {
  prefix: 'm_admin_',
  drivers: ['session','local'], 
});

Tried to use Vue.$localStorage and this.$localStorage.
The first and second methods are undefined (checked using a debugger).

I could not re-produce the issue, check

https://codesandbox.io/s/w7ov5728yk

Some thing is wrong with your code.