22
02/23
使用html5-qrcode 扫描二维码(vue3)
/* Your code... */ <script> import { Html5Qrcode } from "html5-qrcode"; export default { name: 'HelloWorld', props: { msg: String }, mounted(){ console.log('hello...'); this.getCameras(); }, methods:{ getCameras() { Html5Qrcode.getCameras() .then((devices) => { /** * devices would be an array of objects of type: * { id: "id", label: "label" } */ //alert(JSON.stringify(devices)); if (devices && devices.length) { this.came...