Excubo.Blazor.ScriptInjection
1.0.1
See the version list below for details.
dotnet add package Excubo.Blazor.ScriptInjection --version 1.0.1
NuGet\Install-Package Excubo.Blazor.ScriptInjection -Version 1.0.1
<PackageReference Include="Excubo.Blazor.ScriptInjection" Version="1.0.1" />
<PackageVersion Include="Excubo.Blazor.ScriptInjection" Version="1.0.1" />
<PackageReference Include="Excubo.Blazor.ScriptInjection" />
paket add Excubo.Blazor.ScriptInjection --version 1.0.1
#r "nuget: Excubo.Blazor.ScriptInjection, 1.0.1"
#:package Excubo.Blazor.ScriptInjection@1.0.1
#addin nuget:?package=Excubo.Blazor.ScriptInjection&version=1.0.1
#tool nuget:?package=Excubo.Blazor.ScriptInjection&version=1.0.1
This library brings the script tag to Blazor. Since components can occur any number of times, the usage of script tags in components is usually frowned upon. The Script component in Excubo.Blazor.ScriptInjection is different, as it makes sure that the source file is only put into the page's body once.
This can be used to lazily load javascript sources for any component that requires javascript. As a component library author, you can use this to relieve your users of the burden of adding script tags to their pages' <head>. Simply add <Script Src="_content/My.Library/code.js"> to any component in your library that requires that file. Excubo.Blazor.ScriptInjection makes sure the script gets loaded once and only once, regardless of how many components you have, and regardless of how many components your users use.
Usage
1. Add ScriptInjection to your services
//...
//using Excubo.Blazor.ScriptInjection;
services.AddScriptInjection();
//...
2. Use the Script component
<h3>My component requiring some js</h3>
<Script Src="path/to/code.js" Async="true" Defer="false" />
Note: Async and Defer are false by default. It is recommended to use these options wherever possible to improve page performance.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Microsoft.AspNetCore.Components.Web (>= 3.1.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Excubo.Blazor.ScriptInjection:
| Package | Downloads |
|---|---|
|
Basyc.MessageBus.Manager.Presentation.BlazorLibrary
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.1.7 | 3,042 | 12/1/2022 |
| 3.1.6 | 895 | 4/15/2022 |
| 3.1.4 | 594 | 3/9/2022 |
| 3.1.2 | 698 | 2/10/2022 |
| 3.1.0 | 631 | 11/9/2021 |
| 3.0.47 | 588 | 10/22/2021 |
| 3.0.45 | 585 | 9/15/2021 |
| 3.0.37 | 619 | 7/19/2021 |
| 3.0.33 | 543 | 6/11/2021 |
| 3.0.29 | 487 | 5/12/2021 |
| 3.0.25 | 1,011 | 4/7/2021 |
| 3.0.21 | 545 | 3/9/2021 |
| 3.0.17 | 561 | 3/3/2021 |
| 3.0.15 | 594 | 2/10/2021 |
| 3.0.11 | 618 | 1/13/2021 |
| 3.0.7 | 608 | 12/9/2020 |
| 3.0.5 | 606 | 11/13/2020 |
| 3.0.4 | 591 | 11/10/2020 |
| 3.0.3 | 9,042 | 10/13/2020 |
| 3.0.2 | 4,124 | 9/8/2020 |
| 3.0.1 | 3,195 | 8/12/2020 |
| 3.0.0 | 930 | 8/5/2020 |
| 2.0.2 | 3,211 | 6/28/2020 |
| 2.0.1 | 707 | 6/25/2020 |
| 2.0.0 | 700 | 6/25/2020 |
| 1.0.5 | 678 | 6/15/2020 |
| 1.0.4 | 669 | 5/14/2020 |
| 1.0.3 | 687 | 5/13/2020 |
| 1.0.2 | 666 | 5/13/2020 |
| 1.0.1 | 656 | 4/28/2020 |
| 1.0.0 | 751 | 3/31/2020 |