Skip to content

Commit a2b9fad

Browse files
committed
UPDATE v11
1 parent 5e9bf02 commit a2b9fad

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ export class AppComponent {
2121
// Specify the path for the definition file "barcode-scanner.ui.xml" for the scanner view.
2222
uiPath: "https://cdn.jsdelivr.net/npm/[email protected]/dist/",
2323

24+
// showUploadImageButton: true,
25+
// showPoweredByDynamsoft: false,
26+
// scannerViewConfig: {
27+
// showFlashButton: true,
28+
// cameraSwitchControl: "toggleFrontBack",
29+
// },
30+
2431
// Specify custom paths for the engine resources
2532
engineResourcePaths: {
2633
rootDirectory: "https://cdn.jsdelivr.net/npm/",

barcode-scanner-api-samples/scan-single-barcode/react/src/App.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,31 @@ function App() {
88
const hasRun = useRef(false);
99

1010
useEffect(() => {
11-
if(!hasRun.current) {
11+
if (!hasRun.current) {
1212
// Configuration object for initializing the BarcodeScanner instance
1313
const config = {
1414
license: "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", // Replace with your Dynamsoft license key
1515
container: scannerViewRef.current!, // Specify where to render the scanner UI
16-
16+
1717
// Specify the path for the definition file "barcode-scanner.ui.xml" for the scanner view.
1818
uiPath: "https://cdn.jsdelivr.net/npm/[email protected]/dist/",
19-
19+
20+
// showUploadImageButton: true,
21+
// showPoweredByDynamsoft: false,
22+
// scannerViewConfig: {
23+
// showFlashButton: true,
24+
// cameraSwitchControl: "toggleFrontBack",
25+
// },
26+
2027
// Specify custom paths for the engine resources
2128
engineResourcePaths: {
2229
rootDirectory: "https://cdn.jsdelivr.net/npm/",
2330
},
2431
}
25-
32+
2633
// Create an instance of the BarcodeScanner with the provided configuration
2734
const barcodeScanner = new BarcodeScanner(config);
28-
35+
2936
// Launch the scanner; once a barcode is detected, display its text in an alert
3037
barcodeScanner.launch().then((result) => {
3138
if (result.barcodeResults.length) {

barcode-scanner-api-samples/scan-single-barcode/vue/src/App.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ onMounted(() => {
1414
// Specify the path for the definition file "barcode-scanner.ui.xml" for the scanner view.
1515
uiPath: "https://cdn.jsdelivr.net/npm/[email protected]/dist/",
1616
17+
// showUploadImageButton: true,
18+
// showPoweredByDynamsoft: false,
19+
// scannerViewConfig: {
20+
// showFlashButton: true,
21+
// cameraSwitchControl: "toggleFrontBack",
22+
// },
23+
1724
// Specify custom paths for the engine resources
1825
engineResourcePaths: {
1926
rootDirectory: "https://cdn.jsdelivr.net/npm/",

0 commit comments

Comments
 (0)