找了下解決辦法,最後找到原文這個連接,親測有效:
https://blog.csdn.net/sllailc...node
在 node_modules_vux-xscroll@3.1.12@vux-xscrollbuildcmdsimulate-scroll.js下的getScrollTop方法以下
這裏路徑可能不徹底同樣,反正就是源碼庫裏的vux-xscroll裏的simulate-scroll.js文件正則表達式
getScrollTop: function() { var transY = window.getComputedStyle(this.container)[transform].match(/[-\d\.*\d*]+/g); return transY ? Math.round(transY[5]) === 0 ? 0 : -Math.round(transY[5]) : 0; },
將\node_modules\_vux-xscroll@3.1.12@vux-xscroll\build\cmd\simulate-scroll.js下的getScrollTop方法裏面的正則表達式替換成下面(/[-\d\.*\d*e\-\d]+/g )的就能夠了。**ui
getScrollTop: function() { // var transY = window.getComputedStyle(this.container)[transform].match(/[-\d\.*\d*]+/g); var transY = window.getComputedStyle(this.container)[transform].match(/[-\d\.*\d*e\-\d]+/g); return transY ? Math.round(transY[5]) === 0 ? 0 : -Math.round(transY[5]) : 0; },