飞翔的猪i
飞翔的猪i
  • 发布:2017-12-15 18:56
  • 更新:2017-12-15 19:59
  • 阅读:719

下拉刷新 无法触发回调

分类:MUI
//下拉刷新  
        function loadDownData() {  
            console.log(1);  
            var param = {  
                projectId: vm.params.projectId  
            };  
            materSvc.GetMaterialList(param, function(data) {  
                vm.MaterialList = data;  
                mui('#refreshContainer').pullRefresh().endPulldown();  
            });  
        }  

        mui.plusReady(function() {  
            _selfView = plus.webview.currentWebview()  
            main();  
            vm.$set(vm.params, 'projectId', _selfView.projectId);  
            vm.$set(vm.params, 'projTypeId', _selfView.projTypeId);  
            vm.getMaterList();  

            var pullRefreshOptions = {  
                down: {  
                    height: 51,  
                    auto: false,  
                    callback: loadDownData  
                }  
            };  
            console.log(JSON.stringify(pullRefreshOptions));  
            mui("#refreshContainer").pullRefresh(pullRefreshOptions);  
        });
2017-12-15 18:56 负责人:无 分享
已邀请:
nearwmy@gmail.com

nearwmy@gmail.com

我试过这样执行你的代码,是可以打印出1的。或许你应该排查一下你的其他逻辑是否正确

<div id="refreshContainer" class="mui-content mui-scroll-wrapper">   
            <div class="mui-scroll">  
                <!--数据列表-->  
                <ul class="mui-table-view mui-table-view-chevron"></ul>  
            </div>  
        </div>  
        <script src="js/mui.min.js"></script>  
        <script type="text/javascript" charset="utf-8">  
            //mui初始化  
            mui.init();  

            function loadDownData() {  
                console.log(1);  

            }  

            mui.plusReady(function() {  
                var _selfView = plus.webview.currentWebview()  

                var pullRefreshOptions = {  
                    down: {  
                        height: 51,  
                        auto: false,  
                        callback: loadDownData  
                    }  
                };  
                console.log(JSON.stringify(pullRefreshOptions));  
                mui("#refreshContainer").pullRefresh(pullRefreshOptions);  
            });  
        </script>

要回复问题请先登录注册