!3652 doc(#I67AA9): update BarcodeReaders doc

* 优化 BarcodeReaders 组件示例文档
This commit is contained in:
alex_zou 2022-12-24 05:33:59 +00:00 committed by Argo
parent a61735d3fb
commit b569f87d23
4 changed files with 1 additions and 37 deletions

View File

@ -3314,9 +3314,6 @@
"BootstrapBlazor.Shared.Samples.BarcodeReaders": {
"Title": "BarcodeReader",
"SubTitle": "This component scans the bar code by calling the camera to obtain the bar code content bar code/QR code",
"Tips": "<div><code>BarcodeReader</code> Component dependency then expansion package <code>BootstrapBlazor.BarCode</code>, please follow the prompts below for customized installation</div>",
"Nuget": "Install nuget package",
"NugetIntro": "use <a href=\"https://www.nuget.org/packages?q=BootstrapBlazor.BarCode\" target=\"_blank\">nuget.org</a> conduct <code>BootstrapBlazor.BarCode</code>",
"Attention": "Pay special attention to:",
"Li1": "The site wants to enable <code>https</code>, which is required by browser vendors",
"Li2": "The mobile iOS system must use the <code>Safari</code> browser to switch the front/rear camera keys to turn off the function button",

View File

@ -3322,9 +3322,6 @@
"BootstrapBlazor.Shared.Samples.BarcodeReaders": {
"Title": "BarcodeReader 条码扫描",
"SubTitle": "本组件通过调用摄像头对条码进行扫描,获取到条码内容条码/QR码",
"Tips": "<div><code>BarcodeReader</code> 组件依赖扩展包 <code>BootstrapBlazor.BarCode</code>,请按照下面提示进行自定义安装</div>",
"Nuget": "Nuget 包安装",
"NugetIntro": "使用 <a href=\"https://www.nuget.org/packages?q=BootstrapBlazor.BarCode\" target=\"_blank\">nuget.org</a> 进行 <code>BootstrapBlazor.BarCode</code> 组件的安装",
"Attention": "特别注意:",
"Li1": "站点要启用 <code>https</code>,这是浏览器厂商要求的",
"Li2": "移动端 iOS 系统必须使用 <code>Safari</code> 浏览器,切换前/后摄像头要点一下关闭功能按钮",

View File

@ -1,26 +1,10 @@
@page "/barcodereaders"
@inject IStringLocalizer<BarcodeReaders> Localizer
<h3>@Localizer["Title"]</h3>
<h4>@Localizer["SubTitle"]</h4>
<Tips class="mt-3">
@((MarkupString)Localizer["Tips"].Value)
</Tips>
<div><b>@Localizer["Nuget"]</b></div>
<div class="mt-2">@((MarkupString)Localizer["NugetIntro"].Value)</div>
<div class="code-label mt-3">.NET CLI</div>
<Pre class="no-highlight">dotnet add package BootstrapBlazor.BarCode --version @Version</Pre>
<div class="code-label">PackageReference</div>
<Pre class="no-highlight">&lt;PackageReference Include="BootstrapBlazor.BarCode" Version="@Version" /&gt;</Pre>
<div class="code-label">Package Manager</div>
<Pre class="no-highlight">Install-Package BootstrapBlazor.BarCode -Version @Version</Pre>
<PackageTips Name="BootstrapBlazor.BarCode" />
<p><b>@Localizer["Attention"]</b></p>
<ul class="ul-demo">

View File

@ -11,11 +11,6 @@ namespace BootstrapBlazor.Shared.Samples;
/// </summary>
public sealed partial class BarcodeReaders
{
[Inject]
[NotNull]
private VersionService? VersionManager { get; set; }
private string Version { get; set; } = "fetching";
[NotNull]
private BlockLogger? Trace { get; set; }
@ -23,15 +18,6 @@ public sealed partial class BarcodeReaders
[NotNull]
private BlockLogger? Trace2 { get; set; }
/// <summary>
/// <inheritdoc/>
/// </summary>
/// <returns></returns>
protected override async Task OnInitializedAsync()
{
Version = await VersionManager.GetVersionAsync("bootstrapblazor.barcode");
}
private Task OnInit(IEnumerable<DeviceItem> devices)
{
var cams = string.Join("", devices.Select(i => i.Label));