ECMAScript.VeeValidate 1.0.0-preview.8

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

ECMAScript.VeeValidate

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

Strongly typed C# bindings for vee-validate, shipped as a Jazor JS resource library with a locked upstream npm version. Runtime files remain in npm; the package metadata records the entry and dependency graph for the generated jazor project.

上游锁定 Upstream lock

项 值
作者入口 vee-validate
版本 见 manifest.json / inventory.json
许可证 MIT(licenses/vee-validate-LICENSE)
peer 依赖 vue(由 ECMAScript.Vue 资源库提供)

上游发布自包含 ESM entry(vee-validate/dist/vee-validate.mjs),闭包只有该入口一个模块, 唯一裸导入是 vue;Emit 按 npm exports 解析该 package subpath。

首期范围 First slice

  • useForm、useFormContext、useField、useFieldArray
  • 字段状态:useFieldError、useFieldValue、useIsFieldDirty/Touched/Valid
  • 表单状态:useFormErrors、useFormValues、useIsFormDirty/Touched/Valid、useIsSubmitting、useIsValidating、useSubmitCount
  • 状态写入:useSetFieldError/Touched/Value、useSetFormErrors/Touched/Values、useResetForm
  • 校验与提交:useValidateField、useValidateForm、useSubmitForm、configure

未绑定:Form/Field/FieldArray/ErrorMessage 组件、defineRule/normalizeRules 自定义规则(需要 object 值域)、validationSchema 的 yup/zod 适配器(需要 @vee-validate/* 独立包)、validate/validateObject 直接校验入口。需要时按需扩充 Api/VeeValidate.Api.cs。

Not bound: the Form/Field/FieldArray/ErrorMessage components, defineRule/normalizeRules custom rules (they need an object value domain), yup/zod validationSchema adapters (they need separate @vee-validate/* packages), and the direct validate/validateObject entries.

SSR 边界 SSR boundary

useForm、useField 与状态读写组合式函数依赖组件实例与 provide/inject,必须在组件 setup 作用域内调用;handleSubmit 产生的提交处理器依赖浏览器事件与 DOM 生命周期。SSR 期间不要调用这些组合式函数,包也不提供服务器端等价实现。

使用示例 Authoring

using static ECMAScript.VeeValidate;

var form = UseForm(new VeeValidateFormOptions<LoginForm>
{
    InitialValues = new LoginForm { Email = "", Password = "" },
    ValidateOnMount = false
});

var email = UseField<string>("email", "required|email");
var submit = form.HandleSubmit(values => SignIn(values));

// 渲染:submit 直接绑定到提交事件;email.ErrorMessage 显示错误

再生成 Regeneration

dotnet run --file scripts/csharp/generate-vee-validate.cs -- --version <version>
dotnet run --file scripts/csharp/generate-vee-validate.cs -- --source .tmp/p3b/node_modules

测试 Tests

src/ECMAScript.VeeValidate.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 46 10/10/2026
1.0.0-preview.8 47 10/9/2026
1.0.0-preview.7 67 9/29/2026
1.0.0-preview.6 57 9/28/2026
1.0.0-preview.5 56 9/28/2026