docs(migration): update form validation error property name (#4557)

This commit is contained in:
Hugo Richard
2025-07-21 11:24:49 +02:00
committed by GitHub
parent f32cfeef9e
commit e9d515cb85

View File

@@ -536,6 +536,33 @@ import { ModalExampleComponent } from '#components'
</script>
```
### Changed form validation
- The error object property for targeting form fields has been renamed from `path` to `name`:
```diff
<script setup lang="ts">
const validate = (state: any): FormError[] => {
const errors = []
if (!state.email) {
errors.push({
- path: 'email',
+ name: 'email',
message: 'Required'
})
}
if (!state.password) {
errors.push({
- path: 'password',
+ name: 'password',
message: 'Required'
})
}
return errors
}
</script>
```
---
::warning