【发布时间】:2018-08-08 18:29:23
【问题描述】:
代码:
class MyEvent extends Event {
constructor(name) {
super(name);
}
}
var event = new MyEvent("mousemove");
运行时错误:
Uncaught TypeError: Failed to constructor 'Event': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
有没有办法解决这个问题?
【问题讨论】:
标签: typescript