ECMAScript.VueUse 1.0.0-preview.9

This is a prerelease version of ECMAScript.VueUse.
dotnet add package ECMAScript.VueUse --version 1.0.0-preview.9
                    
NuGet\Install-Package ECMAScript.VueUse -Version 1.0.0-preview.9
                    
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.VueUse" Version="1.0.0-preview.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ECMAScript.VueUse" Version="1.0.0-preview.9" />
                    
Directory.Packages.props
<PackageReference Include="ECMAScript.VueUse" />
                    
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.VueUse --version 1.0.0-preview.9
                    
#r "nuget: ECMAScript.VueUse, 1.0.0-preview.9"
                    
#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.VueUse@1.0.0-preview.9
                    
#: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.VueUse&version=1.0.0-preview.9&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ECMAScript.VueUse&version=1.0.0-preview.9&prerelease
                    
Install as a Cake Tool

ECMAScript.VueUse

VueUse 15 的 C# 组合式 API 绑定,作为 Jazor 的 JS resource library 交付:包内锁定上游版本, manifest.json(schema 2)和 inventory.json 记录 npm package、入口、完整性与许可证元数据。

Strongly typed C# composition-API bindings for VueUse 15, shipped as a Jazor JS resource library with a locked upstream npm version. Runtime files remain in npm; metadata describes the dependency graph for the generated jazor project.

上游锁定 Upstream lock

项 值
npm 包 @vueuse/core(并 vendor @vueuse/shared)
版本 见 manifest.json / inventory.json
许可证 MIT(licenses/*-LICENSE)
入口 @vueuse/core(自包含 bundle)、@vueuse/shared(基础工具)
peer 依赖 vue(由 ECMAScript.Vue 资源库提供)

@vueuse/core 会再导出 @vueuse/shared 的成员,因此两个逻辑 import 都进入资源闭包。

首期范围 First slice

按策展清单绑定高频 composable:浏览器与元素(useMouse、useWindowSize、useElementBounding、useIntersectionObserver、useMediaQuery、usePreferredDark、useOnline、useNetwork、useBattery、useFps 等)、存储与设备(useStorage、useLocalStorage、useClipboard、useDark、useColorMode、useTitle、useFavicon、useFullscreen)、时间(useNow、useTimestamp、useTimeAgo、useIntervalFn、useTimeoutFn、useRafFn)、事件(onClickOutside、onKeyDown、onKeyStroke、onKeyUp、onLongPress、useEventListener)与状态/工具(useToggle、usePrevious、useDebounceFn、useThrottleFn、createEventHook、useAsyncState、computedAsync、computedEager、isClient)。

The first slice binds a curated list of high-frequency composables across browser/element, storage/device, time, events, and state/utility groups.

未绑定的上游导出(@vueuse/core 暴露 300+ 成员)按需在 Api/VueUse.Api.cs 追加,无需改动资源闭包。

SSR 边界 SSR boundary

VueUse 的浏览器类 composable 依赖 window/document:useMouse、useWindowSize、useWindowScroll、useElementSize、useElementBounding、useIntersectionObserver、useResizeObserver、useDocumentVisibility、useWindowFocus、useActiveElement、useMediaQuery、usePreferred*、useBattery、useDevicePixelRatio、useFps、useIdle、usePageLeave、useFullscreen 等必须在浏览器生命周期内使用;isClient 用于在 SSR 中分支。useStorage 系列在无 localStorage 环境会退化到内存实现,需按上游语义确认使用边界。

使用示例 Authoring

using static ECMAScript.VueUse;

var mouse = UseMouse();
var size = UseElementSize(elementRef);
var dark = UseDark();
var clipboard = UseClipboard();

// 读取:mouse.X.Value;写入:dark.Value = true

再生成 Regeneration

dotnet run --file scripts/csharp/generate-vueuse.cs -- --version <upstream-version>
dotnet run --file scripts/csharp/generate-vueuse.cs -- --source .tmp/p3/node_modules --version <upstream-version>

生成器校验 registry integrity 与版本一致,并按入口文件裸 import 推导闭包边;上游引入未收录包引用时显式失败。

测试 Tests

src/ECMAScript.VueUse.Test 覆盖 import/manifest/inventory 元数据、npm integrity、上游导出 drift 与编译器 emission;Jazor.EmitTest 覆盖真实 package graph materialization。

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.9 51 10/10/2026
1.0.0-preview.8 43 10/9/2026
1.0.0-preview.7 60 9/29/2026
1.0.0-preview.6 54 9/28/2026
1.0.0-preview.5 56 9/28/2026