npm i qrcodejs2
import QRCode from "qrcodejs2"
v1
new QRCode(document.getElementById("id"), "https://www.baidu.com/")
v2
let qrcode = new QRCode("id", {
width: 128,
height: 128,
colorDark : "#000000",
colorLight : "#ffffff",
//容错级别 容错级别有:(1)QRCode.CorrectLevel.L (2)QRCode.CorrectLevel.M (3)QRCode.CorrectLevel.Q (4)QRCode.CorrectLevel.H
correctLevel : QRCode.CorrectLevel.H
});
qrcode.clear(); // clear the code.
qrcode.makeCode("https://www.baidu.com/"); // make another code.