keepfool
Results
3
comments of
keepfool
场景:在一个宫格页面,每个宫格绑定click事件,上滑或者下滑时可能会触发宫格的click事件。 解决方法,修改**src/fingerd.js**,在处理touchend和touchcancel时阻止事件冒泡 ```javascript injectEvent (event) { if (eventType === EVENT_TYPE.touchend || eventType === EVENT_TYPE.touchcancel) { // 阻止事件冒泡,避免在滚动时触发页面元素的click事件 event.cancelBubble = true } } ```
本教程的时候是用chrome来演示的,没有特别考虑移动端浏览器。实际项目中我们用的也是vue,能够兼容uc的。
vue和vue-router的版本是多少?依赖有正常安装吗?