Open munjalpatel opened 3 years ago
@munjalpatel, Hello!
Tell me please, is there any progress with this? This is a big problem for me now.
I found a temporary solution.
"Lazy" loading of components that use Store.
layouts/default.vue
<template>
<Component :is="componentWithStore" />
</template>
<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
@Component()
export default class extends Vue {
get componentWithStore (): () => Promise<any> {
return () => import('./ComponentWithStore.vue')
}
}
</script>
Your suggestions?
Are you actually calling Vue.use(Vuex)
somewhere before the store is instantiated as the error message suggested?
[vuex] must call Vue.use(Vuex) before creating a store instance.
I am trying to use Vuex Store in my
layout
but can't figure out how to make it work. Here is what I am doing:store/sources.ts
store/index.ts
layouts/default.vue
And the error I get: