How to use Ionic-Storage in Vue 3.0?

I am trying to use ionic-storage in my Vuejs project created using ionic-cli, but I don’t know how to use it! How do I have to create a store / how can I read data from it - do I have to set it as data in a sec or what?

I don’t find any docs about it - does anybody have made experiences with it?

Would be very happy as I love the ionic design and way of usage!


@jannisgo, Actually I am not really using ionic storage from community plugins so much. The reason causes some plugins will have issues or are unable to use with capacitor.

So the solution is using storage of Capacitor and there are their docs. Hope my comment able help u out :slight_smile:

I am using both Ionic Storage and Capacitor Storage in my Vue 3 and Capacitor 3 app. @whitersun, Ionic Storage was built and is maintained by Ionic. They released v3 in March to support non-Angular projects.

The README of the GitHub repo for Ionic Storage does a pretty good job explaining how to set it up and use it. I am using it to persist my Vuex store.

Here is some basic code:

const storage = new Storage({
    storeName: 'vuex'

await storage.set('my_awesome_key', 'some_awesome_value')

const myAwesomeValue = await storage.get('my_awesome_key')

Let me know if you have any specific questions. Using it with Vuex required me to create a wrapper around it and to use a promise queue since mutations are synchronous.

Oh, thank you so much. I will try it for my project, try to change from capacitor storage to ionic storage, and comparison which one is suitable for me.