Click here for a guide on how to type the $store
property. Unfortunately, I've been encountering issues with it.
In my Vue 2 project created using vue-cliI, I included a vuex.d.ts file in ./src directory but the $store
property in my components still shows as type Store<any>
This is the content of my vuex.d.ts file:
//imported from another file
interface State {
// ... definition of my state
}
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$store: Store<State>
}
}
I'm not sure what additional information you may need to identify the problem, so feel free to ask in the comments.