programing

TypeORM 및 Vue 클래스 구성 요소

prostudy 2022. 4. 24. 09:34
반응형

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에 대한 논쟁 유형onNewFamilyChangedany그리고 나서 모든 것이 다시 작동한다.여기서 어디로 가야 할지 잘 모르겠지만, vue-class 컴포넌트에 의해 수행되는 어떤 처리나 변형이 심을 우회하는 것이 아닐까?

참조URL: https://stackoverflow.com/questions/64541196/typeorm-and-vue-class-components

반응형