AKASHAorg / secure-webstore

A secure IndexedDB store with built-in encryption
MIT License
44 stars 6 forks source link

Not working with vue 2 #14

Closed Master-Y0da closed 3 years ago

Master-Y0da commented 3 years ago

I try to set up with vue 2, like this:

`

 import Vue from 'vue'
 import './plugins/axios'
 import App from './App.vue'

 const Store = require('secure-webstore')

 const store = new Store('user_data', 'lachiquichiqui89')

 store.init().then(() => {
   // store is ready
 })

Vue.prototype.$store = store

new Vue({
 router,
 render: h => h(App)
}).$mount('#app')`

But gives me this error Uncaught TypeError: Store is not a constructor

deiu commented 3 years ago

Hi,

I've pushed a new build on npm with new modules. Try importing the Store like this: const Store = require('secure-webstore').Store. I will update the README to reflect this change.

Master-Y0da commented 3 years ago

working now! thanks @deiu