Skip to content

Commit

Permalink
Merge pull request #1 from Jonham/master
Browse files Browse the repository at this point in the history
修复滑动穿透问题: add catchtouchmove to stop scroll actions to the underlying
  • Loading branch information
古月梦雅 authored Jul 7, 2018
2 parents da5d509 + b5470f3 commit ea8bb0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/components/bar-slider/bar-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ Component({
'sliderAin': animation.export(),
'sliderState': true
});
},
/**
* 处理滑动带动不可见层的问题,捕捉touchmove事件,不冒泡
*/
_onNoScroll(ev) {
// console.log(ev)
}
}
})
3 changes: 2 additions & 1 deletion src/components/bar-slider/bar-slider.wxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!--components/bar-slider.wxml-->
<view class="slider-wrap" animation="{{sliderAin}}">
<view class="slider-wrap" animation="{{sliderAin}}"
catchtouchmove='_onNoScroll'>
<view class="slider-header">
<image class="head-bg" src="/static/images/main_nav_header_bg.png"></image>
<text class="head-moon iconfont icon-yueliang"></text>
Expand Down

0 comments on commit ea8bb0a

Please sign in to comment.