gruhn / vue-qrcode-reader

A set of Vue.js components for detecting and decoding QR codes.
https://gruhn.github.io/vue-qrcode-reader
MIT License
2.1k stars 335 forks source link

PaintOutline vue 3 in quasar project #273

Closed abmcr closed 1 year ago

abmcr commented 2 years ago

I have this code in template

<qrcode-stream style='height:100%' :track="paintOutline" @decode="onDecode" @init="onInit" />

and this is the function

paintOutline (detectedCodes, ctx) { for (const detectedCode of detectedCodes) { const [ firstPoint, ...otherPoints ] = detectedCode.cornerPoints ctx.strokeStyle = "red"; ctx.beginPath(); ctx.moveTo(firstPoint.x, firstPoint.y); for (const { x, y } of otherPoints) { ctx.lineTo(x, y); } ctx.lineTo(firstPoint.x, firstPoint.y); ctx.closePath(); ctx.stroke(); } }

The qrcode is decoded but the paintOutline don't work

Uncaught TypeError: detectedCodes is not iterable at Proxy.paintOutline (Index.vue?8b24:34) at eval (VueQrcodeReader.umd.min.js?5282:1)

Quasar version 2.1.9 and vue 3

gruhn commented 2 years ago

Can you console.log(decodedCodes) and show the output?

abmcr commented 2 years ago

Schermata 2021-10-25 alle 09 45 29

github-actions[bot] commented 1 year ago

This issue has been marked as stale. If there is no further activity it will be closed.