File tree Expand file tree Collapse file tree 3 files changed +2
-4
lines changed
5.read-video-vue/src/components Expand file tree Collapse file tree 3 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,6 @@ <h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
2727 * LICENSE ALERT - THE END
2828 */
2929
30- // DBR.productKeys = "PRODUCT-KEYS";
31-
3230 BarcodeReader . engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.0/dist/" ;
3331
3432 let pScanner = null ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default {
1414 methods: {
1515 async decodeImg (e ) {
1616 try {
17- const reader = await (this .pReader = BarcodeReader .createInstance ());
17+ const reader = await (this .pReader = this . pReader || BarcodeReader .createInstance ());
1818 let results = await reader .decode (e .target .files [0 ]);
1919 for (let result of results){
2020 alert (result .barcodeText );
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ export default {
9292 },
9393 async mounted () {
9494 try {
95- const scanner = await (this .pScanner = BarcodeScanner .createInstance ());
95+ const scanner = await (this .pScanner = this . pScanner || BarcodeScanner .createInstance ());
9696 await scanner .setUIElement (this .$el );
9797 scanner .onFrameRead = (results ) => {
9898 for (let result of results) {
You can’t perform that action at this time.
0 commit comments