pixelverse-llc / strich-vue2-sample Goto Github PK
View Code? Open in Web Editor NEWSTRICH Vue 2.x sample code
Home Page: https://strich.io/
License: Creative Commons Zero v1.0 Universal
STRICH Vue 2.x sample code
Home Page: https://strich.io/
License: Creative Commons Zero v1.0 Universal
We error configuration not valid
below vue page
import { ref, onUnmounted } from "vue";
import { mapActions, mapGetters } from "vuex";
import { BarcodeReader, StrichSDK } from "@pixelverse/strichjs-sdk";
const detections = ref([]);
export default {
data() {
return {
dataResourcesLoad: []
}
},
async mounted() {
this.initScan();
},
computed: {
},
methods: {
async initScan() {
// setup STRICH SDK and BarcodeReader
const licenseKey = 'xxxx';
StrichSDK.initialize(licenseKey)
.then(() => {
console.log(`STRICH SDK initialized, version: ${StrichSDK.version()}`);
// configure the BarcodeReader
const configuration = {
selector: '#scanner',
engine: {
symbologies: ['code128']
},
frameSource: {
resolution: 'auto',
}
};
const barcodeReader = new BarcodeReader(configuration);
barcodeReader.initialize()
.then(() => {
// destroy the BarcodeReader when this component is unmounted
onUnmounted(() => {
barcodeReader.destroy();
});
barcodeReader.detected = (newDetections) => {
detections.value.push(newDetections[0]);
console.log(`New scan: [${newDetections[0].data}]`);
};
barcodeReader.start();
});
})
.catch(err => {
window.alert(`STRICH SDK initialization failed: ${err.message}`);
});
}
}
}
</scr ipt>
<div id="scanner">
<!-- STRICH BarcodeReader instantiated here -->
</div>
<p>This sample app is based on Vue 2.x</p>
<ul v-if="detections && detections.length">
<li v-for="detection in detections">
{{ detection.data }}
</li>
</ul>
<p v-else>No barcodes scanned yet.</p>
</section>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.