2020-10-02 07:13:14 +00:00
|
|
|
import { store } from 'quasar/wrappers';
|
|
|
|
import Vuex from 'vuex';
|
|
|
|
|
2020-10-15 01:36:25 +00:00
|
|
|
import user from './module-user';
|
|
|
|
import { UserStateInterface } from './module-user/state';
|
2020-10-02 07:13:14 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If not building with SSR mode, you can
|
|
|
|
* directly export the Store instantiation
|
|
|
|
*/
|
|
|
|
|
|
|
|
export interface StateInterface {
|
|
|
|
// Define your own store structure, using submodules if needed
|
2020-10-15 01:36:25 +00:00
|
|
|
user: UserStateInterface;
|
2020-10-02 07:13:14 +00:00
|
|
|
}
|
|
|
|
|
2020-10-15 01:36:25 +00:00
|
|
|
export default store(function ({ Vue }) {
|
2020-10-02 07:13:14 +00:00
|
|
|
Vue.use(Vuex);
|
|
|
|
|
|
|
|
const Store = new Vuex.Store<StateInterface>({
|
|
|
|
modules: {
|
2020-10-15 01:36:25 +00:00
|
|
|
user
|
2020-10-02 07:13:14 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// enable strict mode (adds overhead!)
|
|
|
|
// for dev mode only
|
|
|
|
strict: !!process.env.DEV
|
|
|
|
});
|
|
|
|
|
|
|
|
return Store;
|
|
|
|
});
|