<scroll-view class="scroll-view_H" scroll-x="false" style="width: 100%; height:{{scroll_page_H}}px" scroll-left='{{scrollLeft}}'>
<view class="fhbox scroll-view-item" style="height:{{Cbox}}" catchtouchmove='catchTouchMove' >
<ec-canvas id="mychart-dom-line" canvas-id="mychart-line" ec="{{ ecline }}" bind:init="echartInit_load_line"></ec-canvas>
</view>
<view class="ydlbox scroll-view-item" catchtouchmove='catchTouchMove' >
<ec-canvas id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ ecBar }}" bind:init='echartInit_electric_bar'></ec-canvas>
</view>
</scroll-view>
wxml部分代码
主要解决方法在 内部组件里添加 catchtouchmove='catchTouchMove'
catchTouchMove(){
return false;
},
js部分 直接在组件内部捕获时间,并且阻止事件。
本文介绍了一种在wxml中通过添加catchtouchmove属性来解决内部组件触摸事件冲突的方法。通过在组件内捕获并阻止事件传播,确保了页面中不同图表组件的触摸操作互不干扰。
3343

被折叠的 条评论
为什么被折叠?



