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;
navigator.getUserMedia =
n

本文介绍了如何在web端实现二维码扫描功能,通过引入reqrcode.js库,并提供了关闭摄像头及模拟微信扫描的CSS样式方法。
最低0.47元/天 解锁文章
2975





