这就是
as _;
如果您曾经想知道这是为了什么,那么类定义的一部分就会出现。
createProductA
和
createProductB
this
或
self
,但让你去做,这正是
as
是的,并且
_
作为_;
例如:。
as self;
你可以参考
自己
试试这个:
class testFactory (factory: abstractFactory) => {
as self;
pub createProductA => factory#createProductA;
pub createProductB => factory#createProductB;
pub test () => {
Js.log self#createProductA;
Js.log self#createProductB;
}
};