How to use the @antv/dom-util.addEventListener function in @antv/dom-util

To help you get started, we’ve selected a few @antv/dom-util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antvis / G2 / packages / component / src / legend / continuous / components / slider.ts View on Github external
private bindCanvasEvents() {
    const containerDOM = this.get('canvas').get('containerDOM');

    const e1 = domUtil.addEventListener(containerDOM, 'mousemove', this.onMouseMove);
    const e2 = domUtil.addEventListener(containerDOM, 'mouseup', this.onMouseUp);
    const e3 = domUtil.addEventListener(containerDOM, 'mouseleave', this.onMouseUp);

    // 清除所有事件的方法,在交互结束的时候执行
    this.clearAllEvents = () => {
      e1.remove();
      e2.remove();
      e3.remove();
    };
  }
github antvis / G2 / packages / component / src / legend / continuous / components / slider.ts View on Github external
private bindCanvasEvents() {
    const containerDOM = this.get('canvas').get('containerDOM');

    const e1 = domUtil.addEventListener(containerDOM, 'mousemove', this.onMouseMove);
    const e2 = domUtil.addEventListener(containerDOM, 'mouseup', this.onMouseUp);
    const e3 = domUtil.addEventListener(containerDOM, 'mouseleave', this.onMouseUp);

    // 清除所有事件的方法,在交互结束的时候执行
    this.clearAllEvents = () => {
      e1.remove();
      e2.remove();
      e3.remove();
    };
  }
github antvis / G2 / packages / component / src / legend / continuous / components / slider.ts View on Github external
private bindCanvasEvents() {
    const containerDOM = this.get('canvas').get('containerDOM');

    const e1 = domUtil.addEventListener(containerDOM, 'mousemove', this.onMouseMove);
    const e2 = domUtil.addEventListener(containerDOM, 'mouseup', this.onMouseUp);
    const e3 = domUtil.addEventListener(containerDOM, 'mouseleave', this.onMouseUp);

    // 清除所有事件的方法,在交互结束的时候执行
    this.clearAllEvents = () => {
      e1.remove();
      e2.remove();
      e3.remove();
    };
  }