2023-03-10 09:37:37 +03:00

17 lines
356 B
JavaScript

import { useStore } from '@/stores/hooks';
export function useValidation(elementName) {
const { $calculation } = useStore();
const hasErrors = $calculation.$validation?.[elementName]?.hasErrors;
if (hasErrors) {
return {
help: 'Некорректные данные',
isValid: false,
};
}
return {
isValid: true,
};
}