引入qrcode.min.js这个文件
<div class="yard" id="qrcode">
<img src="" alt="" style=" width: 200px;height: 200px;background: yellow;">
</div>
<script>
var qrCode = new QRCode(document.getElementById("qrcode"), {
width:200,
height: 200,
});
function makeCode () {
var url = '路径';
qrCode.makeCode( url );
}
makeCode();
</script>