首先,别去相信初始化就能正常滚动的套路,你应该检查下页面有没有
mui(".mui-scroll-wrapper").scroll()
先确定一下页面是否有滚动事件的定义scroll(),若没有,再看看css的坑,我写了好久,因为在index页有一个固定的额底部导航栏,在点击导航的时候会报错,所以我就在公共样式里面添加了
* { touch-action: none; }
属性,结果导致我的所有页面都不能正常滚动,为避免报错和页面不能正常切换,我将这个属性直接写进了index页,公共样式中删去就可以正常上下滚动了
在页面中有
mui(".mui-scroll-wrapper").scroll()
虽然能滚动,但是会有报错
Ignored attempt to cancel a touchstart event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
在有底部导航栏的页面需要单独添加
* { touch-action: none; }
不然会报错
Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
今天针对页面无法正常滚动的ebug和底部导航栏报错的bug就到这了,需要的就看看,走过路过不要错过