HTMLDwebTorchElement
WebComponentHTMLDwebTorchElement小于 1 分钟
访问手电筒设备的 WebComponent;
 继承与 HTMLElement;
<dweb-torch></dweb-torch>
属性
- plugin - 属性值是一个 TorchPlugin 对象; 
- toggleTorch - 属性值是一个 TorchPlugin.toggleTorch() 方法; 
- getTorchState - 属性值是一个 TorchPlugin.getTorchState() 方法; 
方法
- 无
事件
无预定义事件
示例
<body>
  <dweb-torch></dweb-torch>
  <script type="text/javascript">
    const dwebTorch = document.querySelector("dweb-torch");
    dwebTorch.toggleTorch()
  </script>
</body>
平台兼容性
| 属性/方法/事件 | Android | IOS | Desktop-Dev | Desktop | 
|---|---|---|---|---|
| plugin | ✅ | ✅ | ✅ | X | 
| toggleTorch | ✅ | ✅ | ✅ | X | 
| getTorchState | ✅ | ✅ | ✅ | X | 
相关链接
 Powered by  Waline  v2.15.7