TS常见错误

is not assignable to parameter of type 'obj...'  property 'size' is missing in type {...}

这里说了,说明接口里定义的属性,你没有传全,如果你想有的不传,可以设置可选值。

interface abc {
  name: string
  age?:number
}

你可能感兴趣的:(TS常见错误)