Skip to content

Commit b3a18b8

Browse files
committed
If error message was not instance of array it wasn't shown at field on form.
1 parent 11faa3e commit b3a18b8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • vue/dynamicforms/src/components/form/inputs

vue/dynamicforms/src/components/form/inputs/base.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ export function useInputBase(props: BaseProps, emit: BaseEmits) {
3434
},
3535
});
3636

37-
const errorsList = computed(() => props.errors || []);
37+
const errorsList = computed(() => {
38+
if (props.errors != null) {
39+
if (props.errors instanceof Array) return props.errors;
40+
return [props.errors];
41+
}
42+
return [];
43+
});
3844

3945
const errorsDisplayCount = computed(() => errorsList.value.length);
4046

0 commit comments

Comments
 (0)