qrcode.js 插件在 webpack 中的 _android 错误解决

前端生成二维码时,使用的 qrcode.js 插件

在 webpack 中报错:
	_android not work
	Cannot read property '_android' of undefine

解决方法:
	https://github.com/davidshimjs/qrcodejs/issues/148
	https://github.com/davidshimjs/qrcodejs/issues/113

	使用 '未压缩包',修改源码:
		将:if (this._android && this._android <= 2.1) 
		改为:if (this && this._android <= 2.1)

	据说,还有一种是因为使用了严格模式,'use strict;',把 webpack 打包中的文件里的 use strict 全部移除。

	涉及到 webpack 的 babel 插件:
		https://www.npmjs.com/package/babel-plugin-transform-remove-strict-mode

	我这边使用的是 laravel-mix,配置 webpack 没生效,对整套前端构建不是很熟悉,有时间了再搞,mark 下

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值