This is the way I am using vue-stash
Install
npm install vue-stash
Then :
quasar new plugin store
it creates store.js in the src/plugins folder. Open it and add :
// import something here
import VueStash from 'vue-stash'
// leave the export, even if you don't use it
export default ({ app, router, Vue }) => {
// something to do
Vue.use(VueStash)
app.data = {
store: {
// define your data here for example
user: {
name: 'Bob',
email: 'bob@bobby.fr'
}
}
}
}
Then you have to open the quasar config : quasar.conf.js and add ‘store’ in the plugins array
plugins: [
...,
'store'
],
and your good to go. To load the store in your vue files, include :
store: {
\\ precise the date you want top import here, for example as mentioned above
user
}
be careful to completely define your data in the store.js file if you want them to be reactive.