File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
src/BootstrapBlazor.Server Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,17 @@ private IBluetoothService? BluetoothService { get; set; }</Pre>
2121<DemoBlock Title =" @Localizer[" BaseUsageTitle " ]"
2222 Introduction =" @Localizer[" BaseUsageIntro " ]"
2323 Name =" Normal" >
24- <Button Text =" 请求" OnClick =" RequestDevice" ></Button >
25- <Button Text =" 连接" IsDisabled =" @(_blueDevice is not {Connected: false})" OnClick =" Connect" ></Button >
26- <Button Text =" 断开" IsDisabled =" @(_blueDevice is not {Connected: true})" OnClick =" Disconnect" ></Button >
27- <Button Text =" 电量" IsDisabled =" @(_blueDevice is not {Connected: true})" OnClick =" GetBatteryValue" ></Button >
28- <Display Value =" @_batteryValue" ></Display >
24+ <div class =" row form-inline" >
25+ <div class =" col-12" >
26+ <Button Text =" @Localizer[" BluetoothRequestText " ]" OnClick =" RequestDevice" ></Button >
27+ <Button Text =" @Localizer[" BluetoothConnectText " ]" IsDisabled =" @(_blueDevice is not {Connected: false})" OnClick =" Connect" ></Button >
28+ <Button Text =" @Localizer[" BluetoothDisconnectText " ]" IsDisabled =" @(_blueDevice is not {Connected: true})" OnClick =" Disconnect" ></Button >
29+ </div >
30+ <div class =" col-12" >
31+ <label >Battery: <progress value =" @_batteryValue" max =" 100" ></progress ></label >
32+ <Button Text =" @Localizer[" BluetoothGetBatteryText " ]" IsDisabled =" @(_blueDevice is not {Connected: true})" OnClick =" GetBatteryValue" ></Button >
33+ </div >
34+ </div >
2935</DemoBlock >
3036
3137<p class =" code-label mt-3" >1. 服务注入</p >
Original file line number Diff line number Diff line change 58955895 "BluetoothTipsTitle" : " 注意:<code>IBluetoothService</code> 接口实例继承 <code>IAsyncDisposable</code> 路由切换时需要对其进行资源释放,调用其 <code>DisposeAsync</code> 即可" ,
58965896 "NotSupportBluetoothTitle" : " 扫描设备" ,
58975897 "NotSupportBluetoothContent" : " 当前浏览器不支持串口操作,请更换 Edge 或者 Chrome 浏览器" ,
5898+ "BluetoothRequestText" : " 扫描" ,
5899+ "BluetoothConnectText" : " 连接" ,
5900+ "BluetoothDisconnectText" : " 断开" ,
5901+ "BluetoothGetBatteryText" : " 读取电量" ,
58985902 "BaseUsageTitle" : " 基础用法" ,
58995903 "BaseUsageIntro" : " 通过 <code>IBluetoothService</code> 服务,请求与蓝牙设备通讯" ,
59005904 "BluetoothBatteryLevelTitle" : " 蓝牙设备电量" ,
You can’t perform that action at this time.
0 commit comments