ECMAScript.VueRoute 0.26.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package ECMAScript.VueRoute --version 0.26.1
                    
NuGet\Install-Package ECMAScript.VueRoute -Version 0.26.1
                    
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="ECMAScript.VueRoute" Version="0.26.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ECMAScript.VueRoute" Version="0.26.1" />
                    
Directory.Packages.props
<PackageReference Include="ECMAScript.VueRoute" />
                    
Project file
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 ECMAScript.VueRoute --version 0.26.1
                    
#r "nuget: ECMAScript.VueRoute, 0.26.1"
                    
#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 ECMAScript.VueRoute@0.26.1
                    
#: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=ECMAScript.VueRoute&version=0.26.1
                    
Install as a Cake Addin
#tool nuget:?package=ECMAScript.VueRoute&version=0.26.1
                    
Install as a Cake Tool

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.0" />
  <PackageReference Include="Jazor.Vue" Version="0.26.0" PrivateAssets="all" />
  <PackageReference Include="ECMAScript.VueRoute" Version="0.26.0" />
</ItemGroup>

ECMAScript.VueRoute 是独立生态包,不由 Jazor 主包默认携带。Razor 组件项目仍需按需引用 Jazor.Vue

当前支持范围

  • router 与 history:createRouter()createWebHistory()createWebHashHistory()createMemoryHistory()
  • composition API:useRouter()useRoute()useLink() 与公开 injection key。
  • 组件:RouterLinkRouterViewVueRouterLink Razor authoring proxy。
  • 路由记录、RouteLocationRaw、query/params、pushreplaceresolve 与常用导航 guard。

authoring 规则

  • 使用具体 RouteLocationRaw、路由记录和 guard contract,不使用 object / object? 模拟 JavaScript any
  • 普通标量、对象字面量和数组字面量优先直接赋给目标 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、propsredirectmetauseLink() 的完整类型以源码中的对应 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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 30 9/3/2026
0.28.1 38 9/2/2026
0.28.0 34 9/2/2026
0.27.0 38 9/2/2026
0.26.3 87 8/31/2026
0.26.1 84 8/31/2026
0.26.0 74 8/31/2026
0.25.0 80 8/28/2026
0.24.0 89 8/27/2026
0.23.0 84 8/26/2026
0.22.0 80 8/25/2026
0.21.0 97 8/25/2026
0.20.0 92 8/24/2026
0.17.0 97 8/19/2026
0.16.3 96 8/18/2026
0.16.2 109 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
Loading failed