Closed Joycezhangw closed 4 years ago
在mpx中,自定义事件。但无法捕捉到自定义事件,版本是2.1.4 this['event_bind_tap'] = function (event) { console.log(event.target.dataset._el); // 打印出元素信息 };
this['event_bind_tap'] = function (event) { console.log(event.target.dataset._el); // 打印出元素信息 };
在小程序ide中点击内容的时候,会提示:VM707:1 Component "pages/index" does not have a method "__bind_tap" to handle event "tap".
VM707:1 Component "pages/index" does not have a method "__bind_tap" to handle event "tap".
我也是是,这个怎么弄得?
查看this指向是否正确
使用新版本,事件绑定会更简单。
在mpx中,自定义事件。但无法捕捉到自定义事件,版本是2.1.4
this['event_bind_tap'] = function (event) { console.log(event.target.dataset._el); // 打印出元素信息 };
在小程序ide中点击内容的时候,会提示:
VM707:1 Component "pages/index" does not have a method "__bind_tap" to handle event "tap".