I'm using vue.js 3, typescript and vuex 4 for my project.
But I got this error when using this.$store
on my .vue
file
Property '$store' does not exist on type 'CreateComponentPublicInstance<{}, {}, { exchanges: Exchange[]; isValidNodeUrl: boolean; isValidSelectedNetworks: boolean; web3: "" | Web3; privateKey: string; jsonKeystore: string; jsonKeystorePassword: string; ... 24 more ...; botIsRunning: boolean; }, ... 14 more ..., {}>'
I have added vuex.d.ts
based on this document, but still got the same error
https://next.vuex.vuejs.org/guide/typescript-support.html .
import { Store } from "vuex";
import { ComponentCustomProperties } from "vue";
import { State } from "@/interfaces/bot";
declare module "@vue/runtime-core" {
// Declare your own store states.
interface ComponentCustomProperties {
$store: Store<State>;
}
}
Can somebody help me ?
shims-vuex.d.ts
as I said here stackoverflow.com/questions/64412243/…