Uncaught TypeError: ‘caller’, ‘callee’, and ‘arguments’ properties may not be accessed on strict mode functions or the arguments objects for calls to them
出现这个报错是因为mui中的tab-top-webview-main 滑动组件中的js,使用了非严格模式的语法,然而在webpack打包中默认使用了严格模式去打包
解决方法:
1.一号坑:取消掉webpack默认的严格模式打包:
下载:
npm install babel-plugin-transform-remove-strict-mode --save-dev
在bablerc文件中 添加:“plugins”:
{
"plugins": ["transform-remove-strict-mode"]
}
2.使用mui中的横向滑动组件: tab-top-webview-main
注意:二号坑 取消掉第一个div#slider 的fullscreen样式,否则会以全屏展示
<div id="slider" class="mui-slider">
<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
<div class="mui-scroll">
<a class="mui-control-item mui-active" href="#item1mobile" data-wid="tab-top-subp

本文主要介绍了在Vue项目中使用mui的tab-top-webview-main滑动组件时遇到的TypeError,并提供了详细的解决方案,包括:取消webpack的严格模式打包、处理fullscreen样式、在mounted钩子中初始化组件以及解决Chrome浏览器的警告问题。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



