MCPcopy Create free account
hub / github.com/CoderOpen/waimai / initEvent

Method initEvent

front/components/mpvue-echarts/src/wx-canvas.js:47–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45 }
46
47 initEvent() {
48 this.event = {};
49 const eventNames = [{
50 wxName: 'touchStart',
51 ecName: 'mousedown',
52 }, {
53 wxName: 'touchMove',
54 ecName: 'mousemove',
55 }, {
56 wxName: 'touchEnd',
57 ecName: 'mouseup',
58 }, {
59 wxName: 'touchEnd',
60 ecName: 'click',
61 }];
62
63 eventNames.forEach((name) => {
64 this.event[name.wxName] = (e) => {
65 const touch = e.mp.touches[0];
66 this.chart._zr.handler.dispatch(name.ecName, {
67 zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
68 zrY: name.wxName === 'tap' ? touch.clientY : touch.y,
69 });
70 };
71 });
72 }
73}

Callers 2

constructorMethod · 0.95
mrFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected