refactor: #7049
parent
99b5d73a7c
commit
8146b84880
|
@ -70,6 +70,12 @@ export const useForm = (options = {}) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const defineField = (field, fieldOptions) => {
|
const defineField = (field, fieldOptions) => {
|
||||||
|
if (!field) {
|
||||||
|
console.warn('The `name` attribute is required for the field definition.');
|
||||||
|
|
||||||
|
return []; // prevent errors
|
||||||
|
}
|
||||||
|
|
||||||
fields[field]?._watcher.stop();
|
fields[field]?._watcher.stop();
|
||||||
|
|
||||||
states[field] ||= getInitialState(field, fieldOptions?.initialValue);
|
states[field] ||= getInitialState(field, fieldOptions?.initialValue);
|
||||||
|
|
Loading…
Reference in New Issue