diff --git a/src/store/index.ts b/src/store/index.ts index 23f1b28..66623bc 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -3,7 +3,7 @@ import Vuex from 'vuex' import createLogger from 'vuex/dist/logger' import modules from './modules' -import globalNamespace from './global' +import globalNamespace, { RootState } from './global' import { createResetPlugin } from '../plugins/store' Vue.use(Vuex) @@ -16,8 +16,6 @@ const plugins = (() => { return plugins })() -export type RootState = typeof globalNamespace.state - const store = new Vuex.Store( Object.assign(globalNamespace, { modules, diff --git a/src/store/modules/history.ts b/src/store/modules/history.ts index 69ed11d..ebfa364 100644 --- a/src/store/modules/history.ts +++ b/src/store/modules/history.ts @@ -1,7 +1,7 @@ import { Module } from 'vuex' import { Route } from 'vue-router' import invariant from 'tiny-invariant' -import { RootState } from '../index' +import { RootState } from '../global' import { RECORD_MAX_VAL } from '../../constants' export type RecordItem = { diff --git a/src/store/modules/index.ts b/src/store/modules/index.ts index 6bd3280..40e891e 100644 --- a/src/store/modules/index.ts +++ b/src/store/modules/index.ts @@ -1,5 +1,5 @@ import { Module } from 'vuex' -import { RootState } from '..' +import { RootState } from '../global' const requireStoreModule = require.context( '.', diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index f5cf37f..0cdb821 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,6 +1,6 @@ import Vue from 'vue' import { Module } from 'vuex' -import { RootState } from '..' +import { RootState } from '../global' import { Ability, init, RouteWithAbility, reset } from 'v-access' import { userLogin, fetchUserAbilities } from '@/effects' import VueRouter from 'vue-router'