!1635 fix(#I42O73): resolve introduction throw exception when call dispose

* fix: 修复 Dispose 时报错问题
* doc: update resource file
This commit is contained in:
Argo 2021-07-27 14:06:01 +00:00
parent d57d04b69f
commit efc817ec5b
3 changed files with 12 additions and 8 deletions

View File

@ -324,7 +324,7 @@
"P2": "The dependency isBootstrapBlazor > Bootstrap > jQuery",
"P3": "In the latest <a href='template' target='_blank'>Project Template</a> ,the above dependencies are packaged and bundled, which greatly simplifies use",
"UpdateTitle": "Update Log",
"P4": "This component may be released every day <b><code>beta</code></b> version, every <b><code>Thursday</code></b> release <b><code>official version </code></b> Update log<a id='log' data-bs-toggle='popover' title='Update log' data-bs-content='This component may have <b><code >beta</code></b> version released, every <b><code>Thursday</code></b> release <b><code>official version</code></b> update log' data-bs-html='true' href='{0}' target='_blank'>[portal gate]</a>",
"P4": "This component may be released every day <b><code>beta</code></b> version, every <b><code>Thursday</code></b> release <b><code>official version </code></b> <a id='log' data-bs-toggle='popover' title='Update log' data-bs-content='This component may have <b><code >beta</code></b> version released, every <b><code>Thursday</code></b> release <b><code>official version</code></b> update log' data-bs-html='true' href='{0}' target='_blank'>Update log</a>",
"LearnTitle": "Learning materials",
"LearnLi1": "Blazor Official Document",
"LearnLi2": "Use Blazor WebAssembly and Visual Studio Code to generate web applications",

View File

@ -3,8 +3,6 @@
<h3>@Localizer["Title"]</h3>
<p></p>
<p>@Localizer["P1"]</p>
<p>@Localizer["P2"]</p>
@ -45,7 +43,7 @@
<h3>@Localizer["ProjectsShow"]</h3>
<p>@((MarkupString)Localizer["P5",LocalizerUrls!].Value)</p>
<p>@((MarkupString)Localizer["P5", LocalizerUrls].Value)</p>
<p>@Localizer["ShowWebSiteTitle"]<a href="@($"{WebsiteOption.Value.AdminUrl}/Pages")" target="_blank">@WebsiteOption.Value.AdminUrl</a></p>

View File

@ -36,7 +36,7 @@ namespace BootstrapBlazor.Shared.Pages
private IJSRuntime? JSRuntime { get; set; }
[NotNull]
private object[]? LocalizerUrls { get; set; }
private string[]? LocalizerUrls { get; set; }
/// <summary>
///
@ -45,15 +45,17 @@ namespace BootstrapBlazor.Shared.Pages
{
base.OnInitialized();
LocalizerUrls = new object[]
LocalizerUrls = new string[]
{
WebsiteOption.Value.BootstrapBlazorLink,
WebsiteOption.Value.ImageLibUrl + "/stargazers",
WebsiteOption.Value.BootstrapBlazorLink + "/stargazers",
WebsiteOption.Value.BootstrapBlazorLink + "/badge/star.svg?theme=gvp",
WebsiteOption.Value.BootstrapAdminLink
};
}
private bool IsRender { get; set; }
/// <summary>
///
/// </summary>
@ -65,6 +67,7 @@ namespace BootstrapBlazor.Shared.Pages
if (firstRender)
{
IsRender = true;
await JSRuntime.InvokeVoidAsync("$.bb_open");
}
}
@ -75,7 +78,10 @@ namespace BootstrapBlazor.Shared.Pages
/// <returns></returns>
public async ValueTask DisposeAsync()
{
await JSRuntime.InvokeVoidAsync("$.bb_open", "dispose");
if (IsRender)
{
await JSRuntime.InvokeVoidAsync("$.bb_open", "dispose");
}
GC.SuppressFinalize(this);
}
}