javascript - vue project introduces and generates WeChat two-digit plug-in qrcode.js error report
高洛峰
高洛峰 2017-06-12 09:25:14
0
2
959


The page reports an error message, it seems like js library, import error

Introduction method in the project
2. If you use this method to reference import QRCode from '../../common/js/qrcode.js' in the project, the above error will not be reported, but it will Another error is reported, as shown below:

I call it like this in the project:

let qrcode = new QRCode(qrcodeNode, {
    width: 180,
    height: 180,
    colorDark: "#000000",
    colorLight: "#ffffff"
});

I don’t know why, I’m stuck here~~~ If you know the answer, please let me know, thank you very much~

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
迷茫

OK, the problem has been solved, install it directly
1. npm install qrcodejs2 --save
2. import QRCode from 'qrcodejs2'
and you can use it in the Vue project~~~

黄舟

import QRCode from '../../common/js/qrcode.js'

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!