使用vue做项目的时候,导入mui.min.js实现滚动条:

Vue 移除严格模式,使用mui.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中看一下

Vue 移除严格模式,使用mui.js实现滑动功能

2,修改bablerc文件的配置

"plugins"中添加:"transform-remove-strict-mode"

还有加上

"ignore": ["./src/lib/mui/dist/js/mui.min.js"]

Vue 移除严格模式,使用mui.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;

}

 

相关文章:

  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案