Closed
Description
scroller组件,当页面第一次载入完成,手指开始滑动时,如果手指触点在有click事件的组件上时,会触发refresh事件。重现:http://dotwe.org/vue/2dd89d8b9c2c55c16578883247bb0d71
另外,refresh组件pullingDown时dy的值没有呈线性变化,是故意如此设计?headerHeight和maxHeight都为undefined
scroller组件,当页面第一次载入完成,手指开始滑动时,如果手指触点在有click事件的组件上时,会触发refresh事件。重现:http://dotwe.org/vue/2dd89d8b9c2c55c16578883247bb0d71
另外,refresh组件pullingDown时dy的值没有呈线性变化,是故意如此设计?headerHeight和maxHeight都为undefined
Activity
dongnaebi commentedon Feb 14, 2017
issues越堆越多了
dongnaebi commentedon Feb 20, 2017
@littleseven 麻烦看看,这个很影响使用体验
hphua commentedon Mar 6, 2017
@dongnaebi 试下给scroller设置固定高度
hectorqin commentedon Nov 20, 2017
@dongnaebi 请问,你这个问题解决了吗?
OO0O00 commentedon Dec 14, 2017
我尝试出了解决方法:在scroller加载完成后使用dom模块中的scrollToElement方法把整个scroller滚动一下,之后就不会出现触发refresh的问题了。
例如有如下结构:
<scroller>
<refresh style="height:100;">...</refresh>
<div id="nextElementToRefresh">...</div>
...
</scroller>
在scroller中的所有子元素都加载完成后执行如下代码:
if('android' == this.$getConfig().env.platform) { /*我的问题只有在安卓上遇到 ios没有问题*/
/*使用timer是为了保证scroller内的元素被加载*/
this.$call('timer', 'setTimeout', function () {
var el = this.$el('nextElementToRefresh');
dom.scrollToElement(el, {
offset: -99 /*这里的offset必须大于 (refresh元素的高度乘于-1),如果是-100还是会存在问题*/
});
}, 100);
}
我是在we环境下,vue请自动转换。
Hanks10100 commentedon May 16, 2021
This issue is outdated for a long time and will be closed now. You can create a new one if you still have questions.