场景:在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. angular 中如何使用自定义组件

    1.创建header组件 ng g component components/header header.component.ts import { Component, OnInit } from ...

  2. opencv之dlib库人脸识别

    基础知识 python知识: import os,shutil shutil.rmtree("C:\\Users\\yangwj\\Desktop\\test") #删除目录 os ...

  3. ifc构件加载到树形控件中

    void IfcTreeWidget::setParentCheckState(QTreeWidgetItem *item) { if(!item) return; ; int childCount ...

  4. PYTHON指定国内PIP源

    一.LINUX: vi ~/.pip/pip.conf 输入内容: [global]index-url = http://pypi.douban.com/simple/[install]trusted ...

  5. Linux清除痕迹

    Linux清除痕迹 第一种方法: 在退出会话前直接执行: #history -r 清除当前会话的命令历史记录 第二种方法: 在vim中执行自己不想让别人看到的命令 随便用vim打开一个文件 :set ...

  6. Django:文章详情页面评论功能需要登录后才能使用,登录后自动返回到文章详情页

    背景: 文章详情页正在查看文章,想评论一下写的不错,但是需要先登录才能.页面长这个样子: 方案: 1.点击登录链接时,将该页面的URL传递到登录视图中 request.path获取的是当前页面的相对路 ...

  7. 判断浏览器是否ie6

    if ($.browser.msie && ($.browser.version == "6.0") && !$.support.style) { ...

  8. mysql每次update数据,自动更新对应表中时间字段

    mysql 已经创建完成表的情况下, 使得其中的时间字段 在每次 uodate 数据的时候 自动更新事件, 运行如下sql ALTER TABLE tab_name MODIFY COLUMN upd ...

  9. Word 查找替换高级玩法系列之 -- 将换行符替换成回车符

    我们从网上Copy过来的很多Word文档,里面使用的都是换行符,也就是我们常说的软回车,它显示为一个向下的箭头.这些符号不仅碍眼,而且会影响我们后期的排版,尤其是对段落的排版,因为Word里面的段落只 ...

  10. Python反射和内置方法(双下方法)

    Python反射和内置方法(双下方法) 一.反射 什么是反射 反射的概念是由Smith在1982年首次提出的,主要是指程序可以访问.检测和修改它本身状态或行为的一种能力(自省).这一概念的提出很快引发 ...