How to define generic type 'has property' constrint without type definition?

前端 未结 0 854
长发绾君心
长发绾君心 2020-12-01 06:58

Suppose we have to implement the following:

export class Class1 {
    public constructor(param1: T) {
        param1.prop1 = 1; // TS error: T doesn\         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题