rubystarashe / nuxt-vuex-localstorage

MIT License
161 stars 18 forks source link

can not set data #1

Closed SecretKeeper closed 5 years ago

SecretKeeper commented 5 years ago

hello , first thanks for publishing this awesome plugin i have an issue with using it

1.i try like this , in nuxt.config.js

modules: [ 'nuxt-vuex-localstorage' ]

  1. Created localStorage.js in store folder export const state = () => ({ my_custom_value: 33 })
  2. and in view page i use this <div>{{ $store.state.localStorage }}</div>

and the results is:

{ status: true } // there is no my_custom_value

i have also tried with computed load() function but same result

also this is my store/index.js:

import Vuex from 'vuex'; const createStore = () => { return new Vuex.Store({ state: () => ({ counter: 0 }), mutations: { increase (state) { state.counter++ } } }) } export default createStore

rubystarashe commented 5 years ago

check this example https://github.com/rubystarashe/nuxt-vuex-localstorage-example it works fine

SecretKeeper commented 5 years ago

thank you , works very well would you develop this plugin for future?

rubystarashe commented 5 years ago

Of course. There have been a lot of updates this time, so I hope you will take note of them.