【发布时间】:2013-12-18 16:57:11
【问题描述】:
就在一个月前,我遇到了这个问题Closure call with mismatched arguments: function 'call' 与 js 互操作。
现在我对SnapSVG 库也有同样的问题。从那一刻起,我就将它与 JsInterop 结合使用。今天我尝试使用mouseover 函数,我得到了同样的异常。
但是当我将鼠标悬停在 SVG 元素上时,我的函数会被触发四次:
hover in
hover in
hover in
hover in
Breaking on exception: Closure call with mismatched arguments: function 'call'
我试过了:
var img = s.image("$url", x, y, image.width/2, image.height/2);
js.FunctionProxy hover = new js.FunctionProxy(() {
print("hover in");
});
img.mouseover(hover);
和
var img = s.image("$url", x, y, image.width/2, image.height/2);
img.mouseover(() {
print("hover in");
});
这次检查了两次,回调函数没有多余的参数。
【问题讨论】:
标签: callback dart dart-js-interop