BiDiao.AspNetCore.SpaHistory
1.0.21
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Core 3.1
This package targets .NET Core 3.1. The package is compatible with this framework or higher.
dotnet add package BiDiao.AspNetCore.SpaHistory --version 1.0.21
NuGet\Install-Package BiDiao.AspNetCore.SpaHistory -Version 1.0.21
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BiDiao.AspNetCore.SpaHistory" Version="1.0.21" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BiDiao.AspNetCore.SpaHistory" Version="1.0.21" />
<PackageReference Include="BiDiao.AspNetCore.SpaHistory" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BiDiao.AspNetCore.SpaHistory --version 1.0.21
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BiDiao.AspNetCore.SpaHistory, 1.0.21"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BiDiao.AspNetCore.SpaHistory@1.0.21
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BiDiao.AspNetCore.SpaHistory&version=1.0.21
#tool nuget:?package=BiDiao.AspNetCore.SpaHistory&version=1.0.21
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
使用说明
这是一个用于加载 history 模式下的单页面应用程序,模块化开发时效果最佳
注意事项
- 返回页面数据中,会在head中加入meta[name=spa-router-base] 的标签,其值应当取用后,提供为history 如有的base 值进行使用;
- 返回的页面数据中,会修正head 中的base 值,该值会设定为页面所有资源所在路径值的值,保证资源正常加载;
前端开发过程中的说明
- 使用history router 正常进行开发即可。
- 发布模式下,history router baseurl 需要提取并使用 meta[name=spa-router-base] 的值,否则路由识别将不准确;
- 发布模式下,
vue.config或vite.config值应保持默认不设定或设定为./,保证资源识别正确即可。发布后该模块会进行base值修正,使其资源加载正常;
插件使用说明
// 注册插件的写法
services.AddSpaHistory()
.AddSpaOptions("/demo" , builder => // 访问history页面时,可能附加了前缀,该值会写入 meta[name=spa-router-base]。
{
builder.SetAssetsPath("/_content/SpaHistoryModule"); // 资源路径(会写入 base )
builder.SetFallbackFile("/_content/SpaHistoryModule/index.html"); // 最终history 指向的文件路径
});
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- HtmlAgilityPack (>= 1.11.57)
-
net6.0
- HtmlAgilityPack (>= 1.11.57)
-
net8.0
- HtmlAgilityPack (>= 1.11.57)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.