vue项目进入mui.js报错 Uncaught TypeError: ‘caller’, ‘callee’, and ‘arguments’ properties may not be access

MUI组件的一些坑

在引入MUI组件时出现的异常:

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组件不支持严格模式

解决方案

1.借助MUI 的 tab-top-webview-main.html
2.需要去掉mui-fullscren
3.滑动功能 需要调用mui.js 进行初始化
4.导入的mui.js报错 mui.js:3945 Uncaught TypeError: ‘caller’, ‘callee’, and ‘arguments’ properties may not be accessed on strict mode functions or the arguments objects for calls to them.
+ webpage打包好的bundle.js默认启动严格模式 不允许使用caller…所以引起了冲突
+ 解决方案: 禁用webpage打包时的严格模式
+ cnpm i babel-plugin-transform-remove-strict-mode -D
+ .babelrc->{“plugins”:[“transform-remove-strict-mode”]
5.初始化滑动功能 必须放在mounted中(此时DOM树已完全渲染)
6.解决完滑动发现tabbar无法工作了
+ 解决方案: 将tabbar 中的每个mui-tab-item改名,同时将mui.css所有有关mui-tab-item的css样式copy到app的css区域,同样改名
7.仍然报错?
+ .babelrc->{“plugins”: ["./src/lib/mui/js/mui.min.js"]}

vue项目进入mui.js报错 Uncaught TypeError: ‘caller’, ‘callee’, and ‘arguments’ properties may not be access_第1张图片

你可能感兴趣的:(vue项目进入mui.js报错 Uncaught TypeError: ‘caller’, ‘callee’, and ‘arguments’ properties may not be access)