0
界面中是否可以使用类似类型的类?例如,我有一个类动物,我可以使用类似:TypeScript的界面中的类型
interface I {
object: Animal
}
我有恩的错误在这种情况下:
class A {
public static foo(text: string): string {
return text;
}
}
interface IA {
testProp: A;
otherProp: any;
}
class B {
constructor(prop: IA) {
console.log(prop.otherProp);
console.log(prop.testProp.foo('hello!'));
}
}
TS2339:房产“富”是不存在的'A' 型
谢谢,这个作品 –