-
Notifications
You must be signed in to change notification settings - Fork 126
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
First of all, this is a amazing project which help me a lot.
But I have some trouble with Vuex in Typescript
.
This is my // store/about.ts
:
// store/about.ts
import modules from './about'
import { StateType } from '@typing/index'
import { Module } from 'vuex'
type AboutStateType = typeof state
const state = {
aboutInfo: 'info from about state model'
}
const getters = {}
const mutations = {}
const actions = {}
const about: Module<AboutStateType, StateType> = {
namespaced: true,
state,
getters,
mutations,
actions
modules // Here,Typescript have warning: 不能将类型“Module<{ aboutInfo: string; }, VuexModuleType>”分配给类型“ModuleTree<VuexModuleType>”。
}
export { AboutStateType, state }
export default about
And my project directory like this:
In the above example, There are other modules
under the about module
.
But TypeScript Can not Identify the type correctly.
I tried to solve this problem, but still don’t know what to do. Can you provide some help for this ?
Thanks a lot!
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed