19302com
19302com
  • 发布:2019-11-27 15:10
  • 更新:2020-04-08 18:53
  • 阅读:1742

【报Bug】uni.pageScrollTo设置duration: 0时APP报错

分类:uni-app
let _this = this;  
                                uni.createSelectorQuery().in(this).select('#messageList').boundingClientRect(data => {  
                                    this.msgListHeight = data.height;  
                                }).exec();  
                                this.messageLists = [...res.data, ...this.messageLists];  
                                // this.$nextTick(function(){  
                                setTimeout(() => {  
                                    uni.createSelectorQuery().in(_this).select('#messageList').boundingClientRect(data => {  
                                        _this.newMsgListHeight = data.height;  
                                        let scrollTop = _this.newMsgListHeight - _this.msgListHeight;  
                                        if(scrollTop > 0){  
                                            uni.pageScrollTo({  
                                                scrollTop: scrollTop,  
                                                duration: 0  
                                            });  
                                        }  
                                    }).exec();  
                                })

15:02:51.054 TypeError: h.push is not a function
15:02:51.074 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:51.094 at uniapp://ready:182:637666
15:02:51.114 at t.<computed> (uniapp://ready:182:89683)
15:02:51.134 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:51.154 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:51.194 webviewScriptError
15:02:51.214 h.push is not a function
15:02:51.234 TypeError: h.push is not a function
15:02:51.254 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:51.274 at uniapp://ready:182:637666
15:02:51.294 at t.<computed> (uniapp://ready:182:89683)
15:02:51.314 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:51.334 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:51.374 Uncaught TypeError: h.push is not a function at uniapp://ready:182
15:02:51.394 TypeError: h.push is not a function
15:02:51.414 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:51.435 at uniapp://ready:182:637666
15:02:51.454 at t.<computed> (uniapp://ready:182:89683)
15:02:51.474 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:51.494 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:51.534 webviewScriptError
15:02:51.554 h.push is not a function
15:02:51.574 TypeError: h.push is not a function
15:02:51.594 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:51.614 at uniapp://ready:182:637666
15:02:51.634 at t.<computed> (uniapp://ready:182:89683)
15:02:51.654 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:51.674 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:51.714 Uncaught TypeError: h.push is not a function at uniapp://ready:182
15:02:55.894 TypeError: h.push is not a function
15:02:55.914 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:55.934 at uniapp://ready:182:637666
15:02:55.954 at t.<computed> (uniapp://ready:182:89683)
15:02:55.974 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:55.994 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:56.034 webviewScriptError
15:02:56.054 h.push is not a function
15:02:56.074 TypeError: h.push is not a function
15:02:56.094 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:56.115 at uniapp://ready:182:637666
15:02:56.134 at t.<computed> (uniapp://ready:182:89683)
15:02:56.154 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:56.174 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:56.214 Uncaught TypeError: h.push is not a function at uniapp://ready:182
15:02:56.274 TypeError: h.push is not a function
15:02:56.294 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:56.314 at uniapp://ready:182:637666
15:02:56.334 at t.<computed> (uniapp://ready:182:89683)
15:02:56.355 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:56.374 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:56.414 webviewScriptError
15:02:56.434 h.push is not a function
15:02:56.454 TypeError: h.push is not a function
15:02:56.474 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:56.494 at uniapp://ready:182:637666
15:02:56.514 at t.<computed> (uniapp://ready:182:89683)
15:02:56.534 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:56.554 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:56.594 Uncaught TypeError: h.push is not a function at uniapp://ready:182
15:02:57.654 TypeError: h.push is not a function
15:02:57.674 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:57.694 at uniapp://ready:182:637666
15:02:57.715 at t.<computed> (uniapp://ready:182:89683)
15:02:57.734 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:57.754 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:57.794 webviewScriptError
15:02:57.814 h.push is not a function
15:02:57.834 TypeError: h.push is not a function
15:02:57.854 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:57.874 at uniapp://ready:182:637666
15:02:57.894 at t.<computed> (uniapp://ready:182:89683)
15:02:57.914 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:57.934 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:57.974 Uncaught TypeError: h.push is not a function at uniapp://ready:182
15:02:58.034 TypeError: h.push is not a function
15:02:58.054 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:58.074 at uniapp://ready:182:637666
15:02:58.094 at t.<computed> (uniapp://ready:182:89683)
15:02:58.114 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:58.134 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:58.174 webviewScriptError
15:02:58.194 h.push is not a function
15:02:58.215 TypeError: h.push is not a function
15:02:58.234 at Object.addFetchInfo (uniapp://ready:182:636455)
15:02:58.255 at uniapp://ready:182:637666
15:02:58.275 at t.<computed> (uniapp://ready:182:89683)
15:02:58.295 at Object.subscribeHandler (uniapp://ready:182:1513)
15:02:58.315 at Object.A [as subscribeHandler] (uniapp://ready:1:8953)
15:02:58.355 Uncaught TypeError: h.push is not a function at uniapp://ready:182

2019-11-27 15:10 负责人:无 分享
已邀请:
x小菜鸟一枚

x小菜鸟一枚 - 入坑。。。

uni.pageScrollTo({
duration: 0 ,
scrollTop: scrollTop,
});
我也出现了,把duration 放上边就好使了

19302com

19302com (作者)

duration为0时正常,设置动画后第一次触顶加载正常,第二次就报错了

  • Oo0零

    我也是报错

    2019-12-06 13:43

fjy1012

fjy1012

我也这样

7***@qq.com

7***@qq.com

我也遇到了,不过更怪。。。duration为150时小程序正常、APP不正常:设置动画后第一次触顶加载正常,第二次就报错了
设置duration为0 小程序、APP都正常了
另外,一个页面里,两个地方用了uni.pageScrollTo。 必须把两个的duration都设置为0,否则包在"boundingClientRect"里面的uni.pageScrollTo仍然是不正常的

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