1.install 安装 npm install qrcodejs2 --save
2.引入 全局/单文件
项目中在单文件中引入 import QRCode from ‘qrcodejs2’;
若全局引入则在import 导入后,main中将QRCode绑在原型上(Vue.prototype.QRCode),使用时this.$QRCode即可.
colorDark : “#000000”, 前景色
colorLight : “#ffffff”, 背景色
方法:
qrcode.clear(); // clear the code.
qrcode.makeCode(“http://naver.com”); // make another code.