常见命令行浏览器报错

1、listen EADDRINUSE .127.0.0.1:3000

端口号被占用。可能无意启动3000端口,但没有正常关闭,后台的node程序占用3000。

方法一:修改package.json配置的端口号  "scripts": {"start": "webpack-dev-server --open --port 3001"}

方法二:启动任务管理器,关闭进程。

2、'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them

使用了非严格模式的语法。

取消babel的严格模式:https://github.com/genify/babel-plugin-transform-remove-strict-mode

npm install babel-plugin-transform-remove-strict-mode

{
  "plugins":["transform-remove-strict-mode"],
  "ignore":["./src/lib/mui/js/mui.min.js"]
}

3、[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. 

给事件添加passive:true,表示该事件不阻止默认行为,即不调用preventDefault()。可能出现MUI的底部选项卡不能跳转。

passive特性参见http://www.cnblogs.com/ziyunfei/p/5545439.html   https://blog.csdn.net/shenlei19911210/article/details/70198771

方法一:重新给底部选项卡设置事件。还会报错,但是可以点击链接了。*{touch-action:none;}可取消报错信息。

mounted(){
  mui('.mui-bar-tab').on('click','.mui-tab-item',function(){
    document.location.href=this.href;
  });
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章