簡體   English   中英

TS2740 缺少 type、Typescript、NestJS 中的以下屬性

[英]TS2740 is missing the following properties from type, Typescript, NestJS

我有一個界面,用於詳細輸入值:

input DocumentDetailInput {
  vat: Float!
  isSaleWithPrescription: Boolean!
  valueCountRound: Float!
  paymentType: String!
  exportNoBill: Boolean!
}

然后,我只想添加 2 個值:

      detail: {
        vat: input.vat,
        exportNoBill: input.exportNobill
      },

錯誤:

is missing the following properties from type 'DocumentDetail': valueCountRound, isSaleWithPrescription, paymentType.ts(2740)

謝謝大家!! 我有解決方案

const detailInput = {
      vat: input.vat,
      exportNoBill: input.exportNobill
    } as DocumentDetailInput

detail: DocumentDetailInput

現在我不能只是從 DocumentDetailInput 接口中排除東西!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM