[fix bug] pull refreash parent element scrollable error (#247)

当下拉刷新元素的父级有可滚动元素的时候,下拉刷新不可用
This commit is contained in:
Wis 2017-10-26 15:20:35 +08:00 committed by neverland
parent ba463adf0e
commit e006f1402e

View File

@ -28,6 +28,7 @@
<script> <script>
import Loading from '../loading'; import Loading from '../loading';
import Utils from '../utils/scroll';
export default { export default {
name: 'van-pull-refresh', name: 'van-pull-refresh',
@ -140,7 +141,7 @@ export default {
}, },
getCeiling() { getCeiling() {
this.ceiling = (window.scrollY || window.pageYOffset) === 0; this.ceiling = Utils.getScrollTop(Utils.getScrollEventTarget(this.$el)) === 0;
return this.ceiling; return this.ceiling;
}, },