ECMAScript.VueRoute 0.9.0

dotnet add package ECMAScript.VueRoute --version 0.9.0
                    
NuGet\Install-Package ECMAScript.VueRoute -Version 0.9.0
                    
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.9.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ECMAScript.VueRoute" Version="0.9.0" />
                    
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.9.0
                    
#r "nuget: ECMAScript.VueRoute, 0.9.0"
                    
#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.9.0
                    
#: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.9.0
                    
Install as a Cake Addin
#tool nuget:?package=ECMAScript.VueRoute&version=0.9.0
                    
Install as a Cake Tool

ECMAScript.VueRoute

定位:Vue Router 4 的独立强类型 C# binding 与 Razor-to-Vue authoring 接口。

安装

<ItemGroup>
  <PackageReference Include="Jazor" Version="0.9.0" />
  <PackageReference Include="ECMAScript.VueRoute" Version="0.9.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.
  • net11.0

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ECMAScript.VueRoute:

Package Downloads
Jazor.Admin

Jazor admin-shell contracts and native RazorVue components.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.0 0 8/11/2026
0.8.3 0 8/11/2026
0.8.2 0 8/11/2026
0.7.0 40 8/10/2026
0.6.0 39 8/10/2026
0.5.0 33 8/9/2026
0.4.0 41 8/9/2026
0.3.4 42 8/9/2026
0.3.3 50 8/7/2026
0.3.2 44 8/6/2026
0.1.48 50 8/5/2026
0.1.47 39 8/5/2026
0.1.46 43 8/5/2026
0.1.45 44 8/5/2026
0.1.43 50 8/4/2026
0.1.42 80 8/4/2026
0.1.41 90 8/4/2026
0.1.40 109 8/3/2026
0.1.39 99 8/3/2026
0.1.38 96 8/2/2026
Loading failed