场景:在VUE项目中,需要用到横向滚动条,在引入MUI相关的组件后,模板中的代码如下

在控制台中报错

报错内容说的是在严格模式下(strict mode)类型错误

经过推测,觉得可能是mui.js中用到了‘caller’,'callee','arguments'东西,但是,webpack打包好的bundle.js中,默认是启用严格模式的,所以,这两者冲突了

解决方案:

1.把mui.js中的非严格模式的代码改掉,但是去操作mui不现实

2.把webpack打包时候的严格模式禁用掉

2.1在控制台安装插件

cnpm install babel-plugin-transform-remove-strict-mode -D

2.2使用方法

如果使用的是.babelrc插入“plugins”:["transform-remove-strict-mode"]

如果使用的是CLI插入 “$ babel  --plugins  transform-remove-strict-mode  script.js”

如果使用的是Node API 则插入"require("babel-core").transform("code",{plugin:["transfomr-remove-strict-mode"]})"

打开页面拉动横向滚动条,控制台报错

解决办法:

babel-plugin-transform-remove-strict-mode的更多相关文章

  1. [AST Babel Plugin] Transform code, add line:column number for console log

    For example we have current code: function add(a, b) { console.log(a, b) return a + b } function sub ...

  2. [Javascript AST] 1. Continue: Write a simple Babel plugin

    We want to write a Babel Plugin, which move 'const versionRegex = /(/d+)\.(/d+)\.(/d+)/gi' out of fu ...

  3. 简单 babel plugin 开发-使用lerna 工具

    babel在现在的web 应用开发上具有很重要的作用,帮助我们做了好多事情,同时又有 比较多的babel plugin 可以解决我们实际开发上的问题. 以下只是学习下如果编写一个简单的babel pl ...

  4. babel plugin和presets是什么,怎么用?

    https://www.fullstackreact.com/articles/what-are-babel-plugins-and-presets/ 当开发react或者vuejs app时,开发者 ...

  5. [Javascirpt AST] Babel Plugin -- create new CallExpression

    The code we want to trasform: 2 ** 3; a ** b; a **b * c; a ** b ** c; (a+1) ** (b+1); transform to: ...

  6. [AST Babel Plugin] Hanlde ArrowFunction && FunctionExpression

    Continue with previous post: https://www.cnblogs.com/Answer1215/p/12342540.html Now we need to think ...

  7. babel plugin

    a = () => {}, // Support for the experimental syntax 'classProperties' isn't currently enabled ya ...

  8. vue客户端渲染首屏优化之道

    提取第三方库,缓存,减少打包体积 1. dll动态链接库, 使用DllPlugin DllReferencePlugin,将第三方库提取出来另外打包出来,然后动态引入html.可以提高打包速度和缓存第 ...

  9. [Javascript AST] 0. Introduction: Write a simple BabelJS plugin

    To write a simple Babel plugin, we can use http://astexplorer.net/ to help us. The plugin we want to ...

  10. Babel 学习

    一,为了更明白地使用Babel, 先了解Babel 的发展过程. 现在Babel的版本是6, 相对于以前的版本, 它做了重大更新: 1, 模块化:所有的内部组件都变成了单独的包.打开Babel在Git ...

随机推荐

  1. linux cheese摄像机工具在window电脑上显示

    1.SSH Secure Shell Client 2.Xming 实现步骤: 1.运行Xming工具 2.运行SSH Secure Shell Client,登陆linux系统 输入命令:expor ...

  2. EasyUI动态生成菜单

    业务需求:不同角色有不同的权限,我们根据角色加载页面时展示不同的菜单.在easyUI中,菜单一般采用手风琴accordion组件进行展示,一级菜单下可以加载二级菜单,效果如下: 普通用户看到的菜: 管 ...

  3. Spring走向注解驱动编程

    SpringFramework的两大核心,IOC(Inversion of control)控制反转和DI(Dependency Inject)依赖注入,其推崇的理念是应用系统不应以java代码的方式 ...

  4. 123457123457---com.threeapp.ShuiShiYanLiWang01----谁是眼力王

    com.threeapp.ShuiShiYanLiWang01----谁是眼力王

  5. python调用HTMLTestRunner+unittest实现一次执行多个测试类,并生成与每个测试类对应的测试报告,具体看代码,附上整个project代码

    python自动化框架雏形,根据自己需要封装:ui自动化,接口自动化均可适用,python版本为python3.x,不要问我为什么不用python2.x,附上整个project代码:http://fi ...

  6. [转]Postgres-XL 10r1英文文档

    Postgres-XL 是一个完全满足ACID的.开源的.可方便进行水平扩展的.多租户安全的.基于PostgreSQL的数据库解决方案. Postgres-XL 可非常灵活的应用在各类场景中,比如: ...

  7. jQuery BlockUI Plugin Demo 2

    Overview The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without l ...

  8. JQuery.BlockUI使用方法举例

    JQuery.BlockUI是众多JQuery插件弹出层中的一个,它小巧(原版16k,压缩后10左右),容易使用, 功能齐全,支持Iframe,支持Modal,可定制性高也意味他默认谦虚的外表. jQ ...

  9. Linux配置代理IP

    Linux配置代理IP: vim /etc/profile http_proxy=http://username:password@ip:port/ https_proxy=http://userna ...

  10. Flutter状态管理Provider,简单上手

    在之前的文章中介绍了 Google 官方仓库下的一个状态管理 Provide.乍一看这俩玩意可能很容易就被认为是同一个东西,仔细一看,这不就差了一个字吗,有什么区别呢. 首先,你要知道的最大的一个区别 ...