web端实现二维码扫描功能
引入reqrcode.js https://gitee.com/weijunw/erweima/blob/master/erweima-jiexi-demo/reqrcode.js
<canvas
id="qr-canvas"
width="800"
height="600"
style="width: 200px; height: 200px; display: none"
></canvas>
<div class="code-bg">
<video
ref="video"
controls="controls"
id="video"
preload="auto"
autoplay
></video>
<div class="line"></div>
</div>
mounted() {
this.canvas = document.getElementById("qr-canvas");
this.context = this.canvas.getContext("2d");
this.getVideo();
},
getVideo() {
let self = this;
navigato