Похоже, что this.style
не определено
catchItem(e) {
this.style.left = e.pageX - this.clientWidth / 2 + "px"; // either this one
this.style.top = e.pageY - this.clientHeight / 2 + "px";
this.onmousemove = function(e) {
this.style.left = e.pageX - this.clientWidth / 2 + "px"; // or this one
this.style.top = e.pageY - this.clientHeight / 2 + "px";
}
...
}
Поскольку вы не привязываете контекст this.onmousemove
к контексту класса, я подозреваю, что он второй.
По какой причине вы не используете функции стрелок в этом случае?
fix:
catchItem(e) {
this.onmousemove = (e) => {
...
}
or
this.onmousemove = function(e){
...
}
this.onmousemove.bind(this);
}