{"id":13446106,"url":"https://github.com/gruhn/vue-qrcode-reader","last_synced_at":"2025-05-14T00:10:40.694Z","repository":{"id":38711328,"uuid":"100715803","full_name":"gruhn/vue-qrcode-reader","owner":"gruhn","description":"A set of Vue.js components for detecting and decoding QR codes.","archived":false,"fork":false,"pushed_at":"2025-04-22T19:50:06.000Z","size":12116,"stargazers_count":2205,"open_issues_count":3,"forks_count":348,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-05-06T07:08:48.536Z","etag":null,"topics":["barcode","barcode-reader","barcode-scanner","qr-code","qr-codes","qrcode","qrcode-reader","qrcode-scanner","vue","vue-component","vue-components","vue-plugin","vuejs","webrtc"],"latest_commit_sha":null,"homepage":"https://gruhn.github.io/vue-qrcode-reader","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gruhn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-08-18T13:41:44.000Z","updated_at":"2025-05-05T13:54:07.000Z","dependencies_parsed_at":"2023-12-11T02:05:13.642Z","dependency_job_id":"d1d6b7d7-467e-4533-8e19-5a88cbdbe9c6","html_url":"https://github.com/gruhn/vue-qrcode-reader","commit_stats":{"total_commits":370,"total_committers":34,"mean_commits":"10.882352941176471","dds":0.5054054054054054,"last_synced_commit":"35da4e04c7ed4a2716f503367e4b73fc4a89a170"},"previous_names":[],"tags_count":113,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruhn%2Fvue-qrcode-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruhn%2Fvue-qrcode-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruhn%2Fvue-qrcode-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruhn%2Fvue-qrcode-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gruhn","download_url":"https://codeload.github.com/gruhn/vue-qrcode-reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254044343,"owners_count":22005138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barcode","barcode-reader","barcode-scanner","qr-code","qr-codes","qrcode","qrcode-reader","qrcode-scanner","vue","vue-component","vue-components","vue-plugin","vuejs","webrtc"],"created_at":"2024-07-31T05:00:45.783Z","updated_at":"2025-05-14T00:10:38.320Z","avatar_url":"https://github.com/gruhn.png","language":"TypeScript","funding_links":[],"categories":["Libraries","Code","JavaScript","UI组件","TypeScript","Components \u0026 Libraries","UI Components","UI Components [🔝](#readme)"],"sub_categories":["QR code","library/repositories","二维码","UI Components","QR Code","Vue"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://gruhn.github.io/vue-qrcode-reader/logo.png\" alt=\"Logo\" width=\"240\" height=\"240\" style=\"max-width: 100%;\"\u003e\n\n  \u003cbr\u003e\n  \u003cbr\u003e\n\n  \u003ca href=\"https://vuejs.org/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/vue-3-brightgreen.svg\" alt=\"for Vue 3\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://www.npmjs.com/package/vue-qrcode-reader\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/vue-qrcode-reader.svg\" alt=\"npm monthly downloads\"\u003e\n  \u003c/a\u003e\n\n  \u003cbr\u003e\n\n  \u003cimg src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" alt=\"is maintained? yes\"\u003e\n\n  \u003ca href=\"http://opensource.org/licenses/MIT\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/Naereen/StrapDown.js.svg\" alt=\"licence: MIT\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/Naereen/badges\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/badges-awesome-green.svg\" alt=\"badges = awesome\"\u003e\n  \u003c/a\u003e\n\n  \u003cbr\u003e\n\n  \u003ca href=\"https://github.com/semantic-release/semantic-release\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\" alt=\"uses semantic release\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/prettier/prettier\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\" alt=\"code style: prettier\"\u003e\n  \u003c/a\u003e\n\n  \u003cbr\u003e\n\n  \u003ca href=\"https://bundlephobia.com/result?p=vue-qrcode-reader\"\u003e\n    \u003cimg src=\"https://badgen.net/bundlephobia/minzip/vue-qrcode-reader\" alt=\"size minified + gzipped\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://www.npmjs.com/package/vue-qrcode-reader\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/vue-qrcode-reader.svg\" alt=\"npm current version\"\u003e\n  \u003c/a\u003e\n\n  \u003cbr\u003e\n\n  \u003ca href=\"https://github.com/vuejs/awesome-vue\"\u003e\n    \u003cimg src=\"https://awesome.re/mentioned-badge.svg\" alt=\"Mentioned in Awesome Vue\"\u003e\n  \u003c/a\u003e\n\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://gruhn.github.io/vue-qrcode-reader/demos/FullDemo.html\"\u003elive demos\u003c/a\u003e |\n  \u003ca href=\"https://gruhn.github.io/vue-qrcode-reader/api/QrcodeStream.html\"\u003eapi reference\u003c/a\u003e\n\u003c/p\u003e\n\nA set of Vue.js components for detecting QR codes and [various other barcode formats](https://github.com/Sec-ant/barcode-detector?tab=readme-ov-file#barcode-detector) right in the browser:\n\n- :movie_camera: `QrcodeStream` continuously scans frames from a camera stream.\n- :put_litter_in_its_place: `QrcodeDropZone` is an empty region where you can drag-and-drop images to be decoded.\n- :open_file_folder: `QrcodeCapture` is a classic file upload field, instantly scanning all files you select.\n\nAll components are responsive.\nBeyond that, close to zero styling.\nMake them fit your layout.\nUsage is simple and straight forward:\n\n```html\n\u003cqrcode-stream @detect=\"onDetect\"\u003e\u003c/qrcode-stream\u003e\n```\n\n```js\nmethods: {\n  onDetect (detectedCodes) {\n    // ...\n  }\n}\n```\n\n### Preview\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/gruhn/vue-qrcode-reader/master/.github/preview1.gif\" width=\"280\" alt=\"preview screencast 1\" /\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/gruhn/vue-qrcode-reader/master/.github/preview2.gif\" width=\"280\" alt=\"preview screencast 2\" /\u003e\n\u003c/p\u003e\n\n### Related Projects\n\n* [Barcode Detector Polyfill](https://github.com/Sec-ant/barcode-detector)\n* [Svelte Port](https://github.com/ollema/svelte-qrcode-reader)\n\n# Installation :package:\n\n## With NPM\n\nRun\n\n```bash\nnpm install vue-qrcode-reader\n```\n\nYou can import the components independantly\n\n```javascript\nimport { QrcodeStream, QrcodeDropZone, QrcodeCapture } from 'vue-qrcode-reader'\n\nconst MyComponent = {\n  //\n  components: {\n    QrcodeStream,\n    QrcodeDropZone,\n    QrcodeCapture\n  }\n\n  // ...\n}\n```\n\nor register all of them globally right away\n\n```javascript\nimport Vue from 'vue'\nimport VueQrcodeReader from 'vue-qrcode-reader'\n\nVue.use(VueQrcodeReader)\n```\n\n## Without NPM\n\nInclude the following JS file:\n\nhttps://unpkg.com/vue-qrcode-reader/dist/vue-qrcode-reader.umd.js\n\nMake sure to include it after Vue:\n\n```html\n\u003cscript src=\"./vue.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"./vue-qrcode-reader.umd.js\"\u003e\u003c/script\u003e\n```\n\nAll components are automatically registered globally.\nUse kebab-case to reference them in your templates:\n\n```html\n\u003cqrcode-stream\u003e\u003c/qrcode-stream\u003e\n\u003cqrcode-drop-zone\u003e\u003c/qrcode-drop-zone\u003e\n\u003cqrcode-capture\u003e\u003c/qrcode-capture\u003e\n```\n\n# Troubleshooting :zap:\n\n#### I don't see the camera when using `QrcodeStream`.\n\n- Check if it works on the demo page. Especially the [Handle Errors](https://gruhn.github.io/vue-qrcode-reader/demos/HandleErrors.html) demo,\n  since it renders error messages.\n  - The demo works but it doesn't work in my project: Listen for the `error` event to investigate errors.\n  - The demo doesn't work: Carefully review the Browser Support section above.\n    Maybe your device is just not supported.\n\n#### I'm running a dev server on localhost. How to test on my mobile device without HTTPS?\n\n- If your setup is Desktop Chrome + Android Chrome, use [Remote Debugging](https://developers.google.com/web/tools/chrome-devtools/remote-debugging/) which allows your Android device to [access your local server as localhost](https://developers.google.com/web/tools/chrome-devtools/remote-debugging/local-server).\n- Otherwise use a reverse proxy like [ngrok](https://ngrok.com/) or [serveo](https://serveo.net/) to temporarily make your local server publicly available with HTTPS.\n- There are also loads of serverless/static hosting services that have HTTPS enabled by default and where you can deploy your web app for free (e.g. _GitHub Pages_, _GitLab Pages_, _Google Firebase_, _Netlify_, _Heroku_, _ZEIT Now_, ...)\n\n#### Some of my QR codes are not being detected.\n\n- Make sure, there is some white border around the QR code.\n- Test your QR codes in the upstream packages: [`barcode-detector`](https://github.com/Sec-ant/barcode-detector) -\u003e [`zxing-wasm`](https://github.com/Sec-ant/zxing-wasm) -\u003e [`zxing-cpp`](https://github.com/zxing-cpp/zxing-cpp), and file detection issues in the highest-level repository where the problem first occurs.\n\n#### 1D barcodes are not being detected.\n\nThe default value for the `formats` prop is `\"['qr_code']\"`, which reflects the setting before the `formats` prop was available.\nYou'll need to add [other barcode formats](https://github.com/Sec-ant/barcode-detector?tab=readme-ov-file#barcode-detector) to this prop to detect those types of barcodes. \nCheck out [this demo](https://gruhn.github.io/vue-qrcode-reader/demos/FullDemo.html).\n\n#### How to make it work with Vue 2?\n\nSupport is dropped but you can downgrade to vue-qrcode-reader v3.\\* or lower.\n\n#### I get a \"Failed to fetch\" error at runtime for some Wasm file.\n\nThat Wasm file implements the QR code detector.\nUnfortunately, it's not very convenient to bundle this file with the package.\nSo by default we fetch it at runtime from a CDN.\nThat's an issue for offline applications or applications that run in a network with strict CSP policy.\nFor a workaround see: https://github.com/gruhn/vue-qrcode-reader/issues/354\n\n#### `torch` is not supported on my device, although it has a flashlight.\n\nSupport for `torch` is inconsistent across devices, cameras and browsers and operating systems.\nOn some devices the rear camera supports `torch` but the front camera doesn't,\neven if the front camera actually has a flashlight.\n\nFurthermore, `torch` is not supported on iOS at all (last checked iOS 17.1).\n\nVisit [this page](https://gruhn.github.io/vue-qrcode-reader/select-camera-demo.html) with your device.\nThe list of links represents all cameras installed on the device.\nIf you click, the camera should be loaded.\nBelow the camera view the JSON object of \"capabilities\" is printed.\nIf it doesn't contain the key/value pair `\"torch\": true` then flashlight is not supported for that camera.\n\nThis JSON object provided as payload of the [`camera-on` event](https://gruhn.github.io/vue-qrcode-reader/api/QrcodeStream.html#camera-on).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruhn%2Fvue-qrcode-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgruhn%2Fvue-qrcode-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruhn%2Fvue-qrcode-reader/lists"}