为什么 clojurescript 调用一些带有“-”的 js 函数而另一些不调用?
Why does clojurescript call some js functions with "-" and others not?
clojurescript 中的一些函数以连字符 -
开头,例如 .-onload
在 js/window
上下文中或 .-fillstyle
在 canvas 上下文中,而其他函数则像 .getElementById
不要以 -
连字符开头。为什么会有这种特殊性?我在这里错过了什么?
我相信 .- 表示您正在访问 属性。在此处阅读有关 js-interop 的更多信息 http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop
clojurescript 中的一些函数以连字符 -
开头,例如 .-onload
在 js/window
上下文中或 .-fillstyle
在 canvas 上下文中,而其他函数则像 .getElementById
不要以 -
连字符开头。为什么会有这种特殊性?我在这里错过了什么?
我相信 .- 表示您正在访问 属性。在此处阅读有关 js-interop 的更多信息 http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop