【发布时间】:2017-03-09 14:25:55
【问题描述】:
我有很多类具有以下形式。
static defaultInstance() {
if (!defaultInstance) {
defaultInstance = new Child1()
}
return defaultInstance
}
由于他们有一个共同的基类,我想将共同的功能添加到基类中,但不知道如何。
(新的 Child1() 有问题)
【问题讨论】:
-
你试过看这个答案吗? stackoverflow.com/questions/27642239/…
标签: javascript class ecmascript-6