-
I'am using NuxtJS. Main this.vuex = PersistedState.getStoreFromRenderer()
console.log(this.vuex.getState()); Render (As NuxtJS Plugin)import Vue from 'vue'
import Vuex from 'vuex'
import PersistedState from 'vuex-electron-store'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
username: 'Jonas'
},
plugins: [
PersistedState.create()
],
}) or as NuxtJS Storeimport PersistedState from "vuex-electron-store"
export const state = () => ({
username: 'Jonas'
})
export const plugins = [
PersistedState.create({ dev: true, ipc: true, paths: ['username'] })
] |
Beta Was this translation helpful? Give feedback.
Answered by
BetaHuhn
Aug 26, 2021
Replies: 2 comments 16 replies
-
Does it work in the last example ("as NuxtJS Store")? The first one ("As NuxtJS Plugin") is missing the |
Beta Was this translation helpful? Give feedback.
16 replies
-
Fixed in v1.4.13.
const store = await PersistedState.getStoreFromRenderer()
const state = await store.getState()
console.log(state) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
BetaHuhn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed in v1.4.13.
PersistedState.getStoreFromRenderer()
now waits for the renderer to connect and the returns a promise containing the store: