|
@@ -1,7 +1,8 @@
|
|
<template>
|
|
<template>
|
|
<hc-app-config>
|
|
<hc-app-config>
|
|
<router-view />
|
|
<router-view />
|
|
- <div class="absolute top-0 w-full text-center" @click="testClick">测试</div>
|
|
|
|
|
|
+ <div class="absolute top-60px z-9999 w-full text-center" @click="testClick1">测试1</div>
|
|
|
|
+ <div class="absolute top-90px z-9999 w-full text-center" @click="testClick2">测试2</div>
|
|
</hc-app-config>
|
|
</hc-app-config>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -26,15 +27,17 @@ watch(() => [
|
|
setUserTheme(ThemeVal, ColorVal)
|
|
setUserTheme(ThemeVal, ColorVal)
|
|
})
|
|
})
|
|
|
|
|
|
-const testClick = () => {
|
|
|
|
- navigator.usb.requestDevice({ filters: [{}] }).then(device => {
|
|
|
|
|
|
+const testClick1 = () => {
|
|
|
|
+ navigator.usb.requestDevice({ filters: [{ vendorId: 10367 }] }).then(device => {
|
|
console.log(device)
|
|
console.log(device)
|
|
- // 设备已授权
|
|
|
|
- navigator.usb.getDevices().then(devices => {
|
|
|
|
- console.log(devices)
|
|
|
|
- })
|
|
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
- console.error('设备选择失败', error)
|
|
|
|
|
|
+ console.log('未选择')
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const testClick2 = () => {
|
|
|
|
+ navigator.usb.getDevices().then(devices => {
|
|
|
|
+ console.log(devices)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|