반응형
TypeORM 및 Vue 클래스 구성 요소
풀 스택 애플리케이션(앱)을 만들고 있다.
- 백엔드:노드, 유형자, TypeORM
- 프런트엔드:Typecript, Vue(Vue CLI 및 클래스 구성 요소 사용)
웹팩용 TypeORM 심을 사용하여 프런트엔드와 모델을 공유하려고 한다.이것은 대체로 효과가 있다.그러나 구성요소 방법 서명에 도면요소 유형을 사용할 때 다음 오류가 표시됨:
<script lang="ts">
import { Component, Vue, Watch } from "vue-property-decorator";
import { Family } from "@/entity/Family";
@Component()
export default class MyComponent extends Vue {
newFamily: Family | null = null; // <-- *Using Family here compiles and works.*
@Watch("newFamily")
onNewFamilyChanged(val: Family, oldVal: Family): void { // <-- *This throws the error below.*
...
}
오류:
This dependency was not found:
* typeorm in ./src/entity/Family.ts
To install it, you can run: npm install --save typeorm
만약 내가 그것을 바꾼다면Family
에 대한 논쟁 유형onNewFamilyChanged
로any
그리고 나서 모든 것이 다시 작동한다.여기서 어디로 가야 할지 잘 모르겠지만, vue-class 컴포넌트에 의해 수행되는 어떤 처리나 변형이 심을 우회하는 것이 아닐까?
참조URL: https://stackoverflow.com/questions/64541196/typeorm-and-vue-class-components
반응형
'programing' 카테고리의 다른 글
CMS에서 서버측 렌더링된 콘텐츠로 Vue.js에 하이드레이팅하는 방법? (0) | 2022.04.24 |
---|---|
Eclipse에서 SWT 라이브러리를 로드할 수 없음 (0) | 2022.04.24 |
다중 라인 전처리기 매크로 (0) | 2022.04.24 |
gdb 명령 화면이 얼마나 선명하십니까? (0) | 2022.04.24 |
실제로 스택 오버플로 오류를 일으키는 요소는? (0) | 2022.04.24 |