<view @touchmove.stop.prevent="clearPropagation"> </view>
------------------------------------
clearPropagation(e) {
// #ifndef APP-NVUE
e.stopPropagation()
// #endif
}
摘自:uni-popup插件源码
本文通过分析uni-popup插件的源码片段,展示了如何使用`<view@touchmove.stop.prevent>`来阻止事件传播。在条件注释`#ifndefAPP-NVUE`下,使用`e.stopPropagation()`来禁止事件在DOM树中的进一步传播,从而实现特定场景下的事件控制需求。
<view @touchmove.stop.prevent="clearPropagation"> </view>
------------------------------------
clearPropagation(e) {
// #ifndef APP-NVUE
e.stopPropagation()
// #endif
}
摘自:uni-popup插件源码
5592
2万+