source

Vue와 함께 글꼴 awesome을 사용하여 타이프스크립트 빌드 오류 발생

goodcode 2022. 8. 3. 23:13
반응형

Vue와 함께 글꼴 awesome을 사용하여 타이프스크립트 빌드 오류 발생

Vue에서 설정하기 위해 멋진 폰트 웹사이트의 지시에 따랐습니다.main.ts 파일에서 아이콘이 정상적으로 동작하는데도 타이프스크립트 오류가 발생합니다.

Functional ComponentOptions 유형의 인수

FontAwesome의 이 행에서 오류가 발생.아이콘

Vue.component('font-awesome-icon', FontAwesomeIcon)

오류: "Functional Component Options, PropesDefinition >>" 유형의 Arguments는 "ComponentOptions, DefaultMethods, DefaultComputed, PropesDefinition >, Record>" 유형의 파라미터에 할당할 수 없습니다. 속성 '렌더' 유형이 호환되지 않습니다.

이 index.d.ts 파일이 원인입니다.다른 걸로 바꾸면 될 것 같아요.

declare module '@fortawesome/vue-fontawesome' {
  import { FunctionalComponentOptions } from 'vue'
  export const FontAwesomeIcon: FunctionalComponentOptions
  export const FontAwesomeLayers: FunctionalComponentOptions
  export const FontAwesomeLayersText: FunctionalComponentOptions
}

(https://fontawesome.com/how-to-use/on-the-web/using-with/vuejs))의 동일한 코드를 모두 사용해도 오류가 발생합니다.

아무쪼록 잘 부탁드립니다.

언급URL : https://stackoverflow.com/questions/53854570/typescript-build-error-using-font-awesome-with-vue

반응형