ECMAScript.VueRoute
0.26.3
See the version list below for details.
dotnet add package ECMAScript.VueRoute --version 0.26.3
NuGet\Install-Package ECMAScript.VueRoute -Version 0.26.3
<PackageReference Include="ECMAScript.VueRoute" Version="0.26.3" />
<PackageVersion Include="ECMAScript.VueRoute" Version="0.26.3" />
<PackageReference Include="ECMAScript.VueRoute" />
paket add ECMAScript.VueRoute --version 0.26.3
#r "nuget: ECMAScript.VueRoute, 0.26.3"
#:package ECMAScript.VueRoute@0.26.3
#addin nuget:?package=ECMAScript.VueRoute&version=0.26.3
#tool nuget:?package=ECMAScript.VueRoute&version=0.26.3
ECMAScript.VueRoute
定位:Vue Router 4 的独立强类型 C# binding 与 Razor-to-Vue authoring 接口。
本包属于 JS resource library:Vue Router 的已有 runtime ESM 位于包内
manifest.json + dist/**,许可证等附属文件由 manifest 显式声明;C# 程序集只提供映射和
authoring contract。消费方编写的 RazorVue 组件生成到消费程序集的
Jazor.Generated.ModuleCatalog。
安装
<ItemGroup>
<PackageReference Include="Jazor" Version="0.26.3" />
<PackageReference Include="Jazor.Vue" Version="0.26.3" PrivateAssets="all" />
<PackageReference Include="ECMAScript.VueRoute" Version="0.26.3" />
</ItemGroup>
ECMAScript.VueRoute 是独立生态包,不由 Jazor 主包默认携带。Razor 组件项目仍需按需引用 Jazor.Vue。
当前支持范围
- router 与 history:
createRouter()、createWebHistory()、createWebHashHistory()、createMemoryHistory()。 - composition API:
useRouter()、useRoute()、useLink()与公开 injection key。 - 组件:
RouterLink、RouterView及VueRouterLinkRazor authoring proxy。 - 路由记录、
RouteLocationRaw、query/params、push、replace、resolve与常用导航 guard。
authoring 规则
- 使用具体
RouteLocationRaw、路由记录和 guard contract,不使用object/object?模拟 JavaScriptany。 - 普通标量、对象字面量和数组字面量优先直接赋给目标 host 类型。
- lambda、delegate、接口值无法由 C# 直接投影时,使用提供的强类型
From(...)或Add(...)overload,而不是依赖多跳隐式转换。 - return-based navigation guard 是推荐写法;legacy
next(...)仅保留兼容入口。
常用模式
new RouteRecordSingleView
{
Path = "/users",
Component = RawRouteComponent.From(component)
};
BeforeEnter = RouteRecordBeforeEnter.From(
(RouteLocationNormalized to, RouteLocationNormalizedLoaded from) => true);
命名视图、lazy component、props、redirect、meta 和 useLink() 的完整类型以源码中的对应 union / helper contract 为准。
边界
本项目只提供通用 vue-router host mapping,不向 compiler 增加 Router 专用 lowering。binding 命名默认沿用 Vue Router API 词根,只有 C# 无法表达的 runtime 名称才使用显式映射。
验证
dotnet test src/ECMAScript.VueRoute.Test/ECMAScript.VueRoute.Test.csproj
相关文档
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ECMAScript.VueRoute:
| Package | Downloads |
|---|---|
|
Jazor.Admin
Jazor admin-shell contracts and native RazorVue components emitted through Jazor.Generated.ModuleCatalog. |
|
|
ECMAScript.ElementPlus
Element Plus Vue 3 C# bindings and RazorVue contracts backed by package-local manifest.json and dist runtime resources. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.29.0 | 0 | 9/3/2026 |
| 0.28.1 | 0 | 9/2/2026 |
| 0.28.0 | 20 | 9/2/2026 |
| 0.27.0 | 35 | 9/2/2026 |
| 0.26.3 | 84 | 8/31/2026 |
| 0.26.1 | 83 | 8/31/2026 |
| 0.26.0 | 72 | 8/31/2026 |
| 0.25.0 | 79 | 8/28/2026 |
| 0.24.0 | 88 | 8/27/2026 |
| 0.23.0 | 83 | 8/26/2026 |
| 0.22.0 | 79 | 8/25/2026 |
| 0.21.0 | 96 | 8/25/2026 |
| 0.20.0 | 90 | 8/24/2026 |
| 0.17.0 | 96 | 8/19/2026 |
| 0.16.3 | 95 | 8/18/2026 |
| 0.16.2 | 108 | 8/17/2026 |
| 0.16.1 | 97 | 8/17/2026 |
| 0.16.0 | 91 | 8/16/2026 |
| 0.15.0 | 96 | 8/15/2026 |
| 0.14.0 | 93 | 8/14/2026 |