Comments (7)
thank your very much,I used the CDN import to solve itγ
from html5-qrcode.
I recently made an update to the library which makes integration much easier with complete user interface to the scanner. The new class included in the library is called Html5QrcodeScanner
This makes the VueJs component much simpler as well. - Just following lines*
Vue.component('qrcode-scanner', {
props: {
qrbox: Number,
fps: Number,
},
template: `<div id="qr-code-full-region"></div>`,
mounted: function () {
var config = { fps: this.fps ? this.fps : 10 };
if (this.qrbox) {
config['qrbox'] = this.qrbox;
}
function onScanSuccess(qrCodeMessage) {
console.log(qrCodeMessage);
}
var html5QrcodeScanner = new Html5QrcodeScanner(
"qr-code-full-region", config);
html5QrcodeScanner.render(onScanSuccess);
}
});
You may have to update onScanSuccess
and bind it directly with the some component callback - I am sure there are ways to do it - I am just not aware of it.
Using it in html is the same
<qrcode-scanner
v-bind:qrbox="250"
v-bind:fps="10"
style="width: 500px;">
</qrcode-scanner>
Updated demo code here as well - https://github.com/mebjas/html5-qrcode-examples/tree/master/vuejs
from html5-qrcode.
I assume this is copy of #48.
I have not worked with vue before but I assume there is an import error. I'll play around and see how to do it and get back.
from html5-qrcode.
Meanwhile it'd be nice if you could share screenshot or error message here - I am closing the other one as duplicate for now.
from html5-qrcode.
@lintiansheng I have not used vue js before and I went through the basic tutorials to come up with working example
I have defined a component in this js file: https://github.com/mebjas/html5-qrcode-examples/blob/master/vuejs/vuejs/main.js
Vue.component('qrcode-scanner', {
props: {
qrBox: Number,
},
// rest of things ... refer the link to js file
and the set the component in html like
<qrcode-scanner v-bind:qrBox="250" style="width: 500px;"></qrcode-scanner>
from html5-qrcode.
I am sure this is a hacky way to do this, I'll read more about vue and try to implement a proper component
from html5-qrcode.
Closing this issue!
from html5-qrcode.
Related Issues (20)
- [Feature Request] Multiple dynamic html5-qrcode not working
- double camera HOT 2
- Compatibility - [Android] [Chrome] - [Cannot scan codes on Samsung S20 and similar devices]
- Compatibility - [OS] [Browser] - [Reading qr-codes occurs only at an angle of inclination of the phone]
- [Question]
- Not able to detect the barcode attached
- Not able to detect the qrcode HOT 1
- Compatibility - [IOS mobile] [Safari] - [Scanning and uploading barcode image not working ] HOT 8
- Compatibility - [OS] [Browser] - [QR Code scan not work on IOS 17]
- On Chrome Mobile browser when I click Stop scanner I get an error message
- Compatibility - [OS] [Browser] - [What is not working] HOT 1
- Compatibility Issue - [iOS 17.2.3] [Safari] - Only black screen is visible once camera permission is given. HOT 1
- Unable to scan PDF-417 barcode HOT 3
- Add ability to take a screenshot of barcode with the device's camera
- Barely functioning in iOS. Perfect in Android. QR recognition script or app? HOT 10
- Compatibility - iOS 17 - All browsers - Rear camera is not working HOT 1
- Turn off file upload HOT 5
- Compatibility - [OS] [Browser] - NotAllowedError: Permission denied HOT 9
- Problem with turning off barcode scanning when the browser is closed or the browser goes to the background on mobile
- Adjusting the Camera Resolution for Flutter Web App HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html5-qrcode.