diff --git a/src/store/index.ts b/src/store/index.ts index 5e3e1ec..8cc387e 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -19,22 +19,24 @@ import { * with the Store instance. */ -export interface StateInterface { - // Define your own store structure, using submodules if needed - // example: ExampleStateInterface; - // Declared as unknown to avoid linting issue. Best to strongly type as per the line above. - example: unknown +export interface AccountStateInterface { + account: { + username: string + token: string + } + isLogin: boolean + taskList: any[] } // provide typings for `this.$store` declare module '@vue/runtime-core' { interface ComponentCustomProperties { - $store: VuexStore + $store: VuexStore } } // provide typings for `useStore` helper -export const storeKey: InjectionKey> = Symbol('vuex-key') +export const storeKey: InjectionKey> = Symbol('vuex-key') // Provide typings for `this.$router` inside Vuex stores declare module "vuex" { @@ -44,12 +46,8 @@ declare module "vuex" { } } -export default store(function (/* { ssrContext } */) { - const Store = createStore({ - modules: { - // example - }, - +export default store(function(/* { ssrContext } */) { + const Store = createStore({ // enable strict mode (adds overhead!) // for dev mode and --debug builds only strict: !!process.env.DEBUGGING