add-form-validation-rule
Installation
SKILL.md
新增表单校验规则
本 skill 提供一套标准的工作流程,用于为项目的表单验证系统添加新的校验规则。
概述
项目采用 Ant Design Vue 4.x + 自定义规则引擎 的表单验证方案:
- 类型定义:
src/components/atoms/AtmForm/index.ts中的BuiltInRules接口 - 规则实现:
src/hooks/useForm/getAntDFormRules.ts中的规则转换逻辑 - 验证函数:
src/utils/validation/目录下的具体验证实现 - 单元测试:
src/hooks/useForm/getAntDFormRules.spec.ts中的测试用例
核心流程
1. 添加类型定义
位置:src/components/atoms/AtmForm/index.ts