本文介绍了咖啡脚本类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
当我用新的 Kinetic.Stage 替换新的画廊时,代码可以正常工作当我使用驱动类时,它不起作用.
When I replace new Gallery with new Kinetic.Stage the code works properly When I work with the dirived class it does not work.
为什么从 Kinetic.Stage 派生的画廊类型是错误的?
Why is the kind of deriving Gallery from Kinetic.Stage wrong ?
推荐答案
问题 - Kineticjs 对象与咖啡脚本类不兼容".
Problem - Kineticjs Objects are not "compatible" with coffeescript classes.
解决 - 你必须使用其他方式调用超级"
Solving - You have to use other way of calling "super"
此处的示例:http://jsfiddle.net/lavrton/w2EQD/4/
UPD:我发现这个问题只存在于构造函数"方法中.其他人也可以:
UPD: I found that this problem exists only for "constructor" method. Ok for others:
这篇关于咖啡脚本类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!