d***@163.com
d***@163.com
  • 发布:2017-08-03 17:25
  • 更新:2017-08-03 19:42
  • 阅读:1653

官方demo禁用上拉加载,真机运行BUG

分类:MUI

官方hello mui DEMO 里面pullrefresh.html中,
28行muI.init初始化后
调用mui('#pullrefresh').pullRefresh().disablePullupToRefresh();
-28 mui.init({
-29 pullRefresh: {
-30 container: '#pullrefresh',
-31 down: {
-32 style:'circle',
-33 callback: pulldownRefresh
-34 },
-35 up: {
-36 auto:true,
-37 contentrefresh: '正在加载...',
-38 callback: pullupRefresh
-39 }
-40 }
-41 });
-42 mui('#pullrefresh').pullRefresh().disablePullupToRefresh();
在真机运行时,会报错,提示:
mui(...).pullRefresh(...).disablePullupToRefresh is not a function at examples/pullrefresh.html:42
mui版本3.70
我的测试机子为ZUK Z1

2017-08-03 17:25 负责人:无 分享
已邀请:
d***@163.com

d***@163.com (作者)

setTimeout(function(){
mui('#pullrefresh').pullRefresh().disablePullupToRefresh();
},1000)
用setTimeout延迟1秒后执行,真机运行就不会报错,问题解决。
看来mui初始化需要的时间,不能马上执行禁止上拉

  • 全栈工程师

    一直报这个 pullrefresh_with_tab.html?__hbt=1524410897527:524 Uncaught TypeError: Cannot read property 'disablePullupToRefresh' of undefined

    2018-04-22 23:48

该问题目前已经被锁定, 无法添加新回复