This library provides Vue.js components, `StreamBarcodeReader` and `ImageBarcodeReader`, enabling barcode and QR code scanning within web applications. It leverages the ZXing ("zebra crossing") image processing library for its core decoding capabilities, supporting various 1D and 2D formats from either a live video camera feed or uploaded image files. The current latest version, 1.0.3, was published approximately three years ago, with Vue 3 compatibility introduced in version 1.0.0. For applications requiring Vue 2 support, users must install version 0.0.3. While the package offers straightforward integration, community forks like `@teckel/vue-barcode-reader` describe this original package as abandoned, suggesting a lack of active maintenance and potential for unaddressed issues or performance improvements found in alternatives. TypeScript definitions are available via `@types/vue-barcode-reader` for better developer experience.
npm install vue-barcode-readerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up both `StreamBarcodeReader` for live camera scanning and `ImageBarcodeReader` for image file scanning within a Vue 3 component. It includes handlers for successful decodes, camera loading, and error states, displaying the last decoded value.
Update any `beforeDestroy` hooks in your components to `beforeUnmount` when migrating to Vue 3 and using `vue-barcode-reader` v1.0.0 or higher.
For ongoing support and new features, evaluate migrating to `@teckel/vue-barcode-reader` or other actively maintained barcode scanning libraries for Vue.
Install the correct version for your Vue environment: `npm install vue-barcode-reader@0.0.3` for Vue 2, or `npm install vue-barcode-reader` (latest) for Vue 3.
Always log the `result` parameter passed to your `@decode` handler to confirm its structure. If you need the full result object, consider if the `@result` event is available in your version.
Upgrade to `vue-barcode-reader@1.0.1` or a later version to resolve Vite compatibility issues: `npm update vue-barcode-reader`.
Replace `beforeDestroy` with `beforeUnmount` in your Vue 3 components to align with the Vue 3 API.
Ensure you `import { StreamBarcodeReader } from 'vue-barcode-reader';` and include it in your component's `components` option: `{ components: { StreamBarcodeReader } }`.Prompt the user for camera permissions, ensure your application is served over HTTPS (required by most browsers for camera access), and instruct users to manually grant camera access if they previously denied it.
Upgrade your `vue-barcode-reader` package to version 1.0.1 or newer to benefit from Vite support fixes: `npm update vue-barcode-reader`.
No dependency data recorded yet.