vuex-module-decorators icon indicating copy to clipboard operation
vuex-module-decorators copied to clipboard

How to use dynamic modules with SSR?

Open Arsync opened this issue 4 years ago • 1 comments

Need an example of how to use dynamic modules with SSR, when store is wrapped into callback like this:

import Vuex from 'vuex';

import { store } from 'quasar/wrappers';
import { IRootState } from './types';

export default store(({ Vue }) =>
{
    Vue.use(Vuex);

    return new Vuex.Store<IRootState>({
        strict: !!process.env.DEV
    });
});

So we can't get store instance just by import - it always create a new one. And unable to pass 'store' instance into @Module({ dynamic: true, store: store, name: 'mm' }) decorator as parameter.

Arsync avatar Aug 26 '20 20:08 Arsync

搞了两天,终于解决存储的问题了

raohuiyong avatar Jul 12 '23 09:07 raohuiyong