我将尝试在我的Typescript代码中使用Foundation的Reveal插件,具体方式如下(为了易读性进行了修改):
那么应该如何编写呢?
var popup = new Foundation.Reveal($('#element'));
在编译过程中,我遇到了以下错误(最终编译成功并正常运行):
TS2350: Only a void function can be called with the 'new' keyword.
那么应该如何编写呢?
var popup = Foundation.Reveal($('#element'))
(即不包括new
)。 - Nitzan Tomer