HTMLDwebBarcodeScanningElement.startScanning()
WebComponentHTMLDwebBarcodeScanningElementstartScanning小于 1 分钟
开始扫一扫
HTMLDwebBarcodeScanningElement.startScanning()
参数
- 无
返回值
返回一个Promise,resolve兑现一个ScanResult对象;
示例
<body>
<dweb-barcode-scanning></dweb-barcode-scanning>
<button>scanner</button>
<script type="module">
import "@plaoc/plugins"
const barcodeScanner = document.querySelector("dweb-barcode-scanning")!
const btn = document.querySelector('button');
btn.addEventListener('click', async () => {
const res = await barcodeScanner.startScanning();
})
</script>
</body>
平台兼容性
属性/方法/事件 | Android | IOS | Desktop-Dev | Desktop |
---|---|---|---|---|
startScanning | ✅ | ✅ | ✅ | X |
相关链接
Powered by Waline v2.15.7