I'm currently working on a project using vue.js 3, typescript, and vuex 4. However, I encountered an issue while trying to use this.$store
in 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 ..., {}>'
Even after following the instructions in the vuex.d.ts
document provided here: , I continue to encounter the same error.
import { Store } from "vuex";
import { ComponentCustomProperties } from "vue";
import { State } from "@/interfaces/bot";
declare module "@vue/runtime-core" {
// Define your own store states.
interface ComponentCustomProperties {
$store: Store<State>;
}
}
If anyone has any suggestions or solutions, please assist me with resolving this issue.