【发布时间】:2018-09-13 11:39:42
【问题描述】:
您好,我在打字稿中有以下错误:
class A {
constructor() {
this.init();
}
public init() {
console.log('a')
}
}
class B extends A {
constructor(public text) {
super();
}
public init() {
console.log(this.text)
}
}
new B('text');
控制台写入未定义。 可以做些什么来克服它。
【问题讨论】:
标签: typescript oop