有没有人能告诉我怎么在ionic 2上禁用数据截取?
在Ionic-v1上,诀窍是在div映射容器(ion- data-tap-disabled="true" )中输入内容。
我安装了这个支持移动触摸的leaflet draw插件leaflet-draw-with-touch,不幸的是,我仍然不能用平板电脑的笔在地图上绘图……
提前感谢
发布于 2018-07-23 16:58:13
点击事件由node_modules/ionic-angular/tap-click/tap-click.js处理
当this.dispatchClick为undefined或false时,方法shouldCancelClick()返回true,这是由绑定到mousedown事件的pointerStart()设置的。
作为一种解决方法,我在地图加载后触发了mousedown + mouseup事件:
@ViewChild('map') mapNode: ElementRef;
ionViewDidEnter() {
// init map here
....
var e1 = document.createEvent('MouseEvents');
e1.initEvent('mousedown', true, true);
this.mapNode.nativeElement.dispatchEvent(e1);
var e2 = document.createEvent('MouseEvents');
e2.initEvent('click', true, true);
this.mapNode.nativeElement.dispatchEvent(e2);
}https://stackoverflow.com/questions/46093420
复制相似问题