programing

Vue.js 3 속성 '$store'가 'CreateComponentPublicInstance' 유형에 없습니다.

prostudy 2022. 6. 20. 20:56
반응형

Vue.js 3 속성 '$store'가 'CreateComponentPublicInstance' 유형에 없습니다.

프로젝트에는 vue.js 3, typescript 및 vuex 4를 사용하고 있습니다.그런데 사용하다가 이 에러가 났어요.this.$store나의 위에.vue파일

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 ..., {}>'

추가했습니다.vuex.d.ts이 문서에 근거하고 있습니다만, 같은 에러(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>;
  }
}

누가 나 좀 도와줄래?

tsconfig.json을 확인합니다.에서 파일을 식별할 수 없습니다.다시 삭제하여 파일을 추가해 주세요.

언급URL : https://stackoverflow.com/questions/67900578/vue-js-3-property-store-does-not-exist-on-type-createcomponentpublicinstance

반응형