Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
添加运行时 mixin 时,return this返回的是 mixin 的类型,而不是已经混入的类,即使设置方法的返回类型也不会强制转换,反而会抛出错误。我怎么return this能从 mixin 方法做呢?
return this
您可以使用metaClass.owner而不是this.
metaClass.owner
this