使用vue做项目的时候,导入mui.min.js实现滚动条:
但是报错:
Uncaught TypeError: ‘caller’, ‘callee’, and ‘arguments’ properties may not be accessed on strict mode functions or the arguments objects for calls to them
因为mui.js中是使用了‘caller’, ‘callee’, and ‘arguments’,但是vue启用严格模式,两者冲突
可以选择,移除严格模式,要使用到下面的这个插件
1,安装
npm install babel-plugin-transform-remove-strict-mode -D
安装之后到package.json中看一下
2,修改bablerc文件的配置
"plugins"中添加:"transform-remove-strict-mode"
还有加上
"ignore": ["./src/lib/mui/dist/js/mui.min.js"]
重新运行,应该没问题了,页面可以出来了,但是滑动的时候还是有报错:
Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080`
3,页面所在css处加上
*{
touch-action: none;
}