[Vuejs]-Saving data directly to the localStorage from axios response in Electron-Vue application

0πŸ‘

βœ…

I use vue-localStorage. For some reason it don’t do an Array-to-string conversion right:

this.$localStorage.set('data', data) // data will be not an Array, but an Observer instance

This is why I had Object instances stored right, but an error with Arrays. So to fix it you need to work with localStorage directly, like this:

localStorage['data'] = JSON.stringify(data)

People, who told me to check localStorage were partly right – the problem was in localStorage yet.

Leave a comment