这是mixin的bug,还是有一些我不知道的设计用意 #1824
Unanswered
seaningihub
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
我在使用mixin的过程中,遇到了几个bug;我解决了部分,但我不太清楚mixin为什么没有支持这些。所以想请教作者以及大家,单纯的是bug,还是有何设计用意;
bug 示例:
BlueprintTest 是一个蓝图类,它有一个函数 Enter:
TSClassB 是一个mixin的ts类,它同时继承于 TSClassA;
TSClassA是一个纯TS类:
执行蓝图类的 Enter,就会报错:
TypeError: this.FunctionA is not a function
这是因为 uelazyload.js中的mixin函数,只添加了 mixinClass的原型,而没有递归mixinClass的原型链:
以及另一个问题:由于这里只添加了 function,但没有管ts类中的新增变量。这就导致变量的初始化是无效的:
Beta Was this translation helpful? Give feedback.
All reactions